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
{{ message }}
Repository navigation
Extend Regex alternation source generator optimization to small sets #62438
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]".
Activity