Disable Unicode support for C# to match Java, Rust, C, C++ #26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The C benchmark does not enable Unicode support (it doesn't pass
PCRE_UTF*
option) nor does the C++ Boost benchmark (it doesn't useu32regex
) and Java doesn't either (it doesn't setPattern.UNICODE_CHARACTER_CLASS
nor add the?U
option). Rust (since #21) explicitly passes.unicode(false)
.C# however is laboring with matching Unicode character classes. To be fair, this adds RegexOptions.ECMAScript. The flag has other effects, but disabling Unicode is the only effect that is relevant to this benchmark - the other ones relate to aspects of the pattern that aren't present in this benchmark's patterns.
This increases C# perf by about ~45% on 3.1. It's still some distance off Rust/C/C++ but it brings it in line with Java (at least with the improvements in .NET 5.0) which is nice.
cc @stephentoub