You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Regex source generator, we special-case alternations where every branch begins with a different char, preferring to generate a switch statement, e.g. "abc|def" yields a switch statement with a case for 'a' and a case for 'd', as the implementation sees that all branches begin with a different character and thus there's no need to fall through from one case to the next, nor backtrack. However, we don't currently extend this to small sets, e.g. "[Aa]bc|[Dd]ef" could similarly benefit from a switch. This will be even more impactful now that IgnoreCase produces sets for all case-equivalent variations of a letter, e.g. "abc|def" under IgnoreCase producing the equivalent of "[Aa][Bb][Cc]|[Dd][Ee][Ff]".
The text was updated successfully, but these errors were encountered:
Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions
See info in area-owners.md if you want to be subscribed.
Issue Details
In the Regex source generator, we special-case alternations where every branch begins with a different char, preferring to generate a switch statement, e.g. "abc|def" yields a switch statement with a case for 'a' and a case for 'd', as the implementation sees that all branches begin with a different character and thus there's no need to fall through from one case to the next, nor backtrack. However, we don't currently extend this to small sets, e.g. "[Aa]bc|[Dd]ef" could similarly benefit from a switch. This will be even more impactful now that IgnoreCase produces sets for all case-equivalent variations of a letter, e.g. "abc|def" under IgnoreCase producing the equivalent of "[Aa][Bb][Cc]|[Dd][Ee][Ff]".
joperezr
added
help wanted
[up-for-grabs] Good issue for external contributors
and removed
untriaged
New issue has not been triaged by the area owner
help wanted
[up-for-grabs] Good issue for external contributors
labels
Dec 6, 2021
In the Regex source generator, we special-case alternations where every branch begins with a different char, preferring to generate a switch statement, e.g. "abc|def" yields a switch statement with a case for 'a' and a case for 'd', as the implementation sees that all branches begin with a different character and thus there's no need to fall through from one case to the next, nor backtrack. However, we don't currently extend this to small sets, e.g. "[Aa]bc|[Dd]ef" could similarly benefit from a switch. This will be even more impactful now that IgnoreCase produces sets for all case-equivalent variations of a letter, e.g. "abc|def" under IgnoreCase producing the equivalent of "[Aa][Bb][Cc]|[Dd][Ee][Ff]".
The text was updated successfully, but these errors were encountered: