Skip to content

chore: Add performance related minor code modifications - #3344

Open
filzrev wants to merge 3 commits into
dotnet:masterfrom
filzrev:chore-cleanup-code
Open

filzrev wants to merge 3 commits into
dotnet:masterfrom
filzrev:chore-cleanup-code

Conversation

@filzrev

@filzrev filzrev commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

This PR contains following minor code modifications

What's changed in this PR

1. Modfy DotNetCliCommandExecutor.cs
Replace code to use string.Split instead of creating non-cached compiled regex instance.
(This code path is called only once. so there is no need to create regex instance)

2. Replace code that using double-lookup
Replace existing codes that using double-lookup to use TryGet* pattern instead.

3. Replace existing read-only dictionary to use FrozenDictionary
System.Collections.Immutable package is already transitively referenced by other packages.
So FrozenDictionary can be used on all platforms.

Note

These changes are suggested when using analyzing-dotnet-performance dotnet-skill (https://github.com/dotnet/skills)
And there are remaining suggestions exists not handled yet.
To code review costs lower. It might be better to run these skills and fix code on maintainer side.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant