Skip to content

Conversation

@Alex-Sob
Copy link

@Alex-Sob Alex-Sob commented Sep 1, 2025

I would like to suggest some performance improvements in SymbolNamesWithValueOption<TValue> class:

  • Currently the nested SymbolNamesWithValueOption<TValue>.NameParts type is a class, it seems that it could be a struct instead as it it's a type that just holds two values.

  • Create method counts wildcard characters by calling Count method on a string. It can be replaced with IndexOf which removes a delegate (and maybe could even take advantage of vectorization, if runtime supports that). Also, the check if there's more than one wildcard can be removed because if a symbol name contains a wildcard then the method expects that it's the last character, otherwise it skips processing it.

  • Fixed CA1847 in Create method and removed suppression.

@Alex-Sob Alex-Sob requested a review from a team as a code owner September 1, 2025 08:48
@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2025

This PR is targeting main, which is now for .NET 11-facing work. If you intended to target .NET 10, either retarget this PR to release/10.0.1xx or make sure you backport the change to release/10.0.1xx after merging. See #50394 for more details.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants