Add Replace and GlobalReplace performance benchmarks to regex - #78
Merged
Conversation
copybara-service
Bot
force-pushed
the
test_967697691
branch
4 times, most recently
from
August 20, 2026 11:49
e4da6e7 to
b8ff4ea
Compare
This also releases our benchmark to the open source repository. Add comprehensive microbenchmarks comparing `regex` and `RE2` across all `Replace` and `GlobalReplace` APIs and usage patterns Across Perflab measurements, `regex` outperforms `RE2` by 2.1x-2.2x on global literal replacements, achieves 1.3x-2.6x higher scan throughput on no-match haystacks (up to 15.6 GiB/s), and is up to 6.9x faster on single capture replacements for typical buffer sizes (<= 32 KB). PiperOrigin-RevId: 967747625
copybara-service
Bot
force-pushed
the
test_967697691
branch
from
August 20, 2026 11:58
b8ff4ea to
9863b39
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add Replace and GlobalReplace performance benchmarks to regex
This also releases our benchmark to the open source repository.
Add comprehensive microbenchmarks comparing
regexandRE2across allReplaceandGlobalReplaceAPIs and usage patternsAcross Perflab measurements,
regexoutperformsRE2by 2.1x-2.2x on global literal replacements, achieves 1.3x-2.6x higher scan throughput on no-match haystacks (up to 15.6 GiB/s), and is up to 6.9x faster on single capture replacements for typical buffer sizes (<= 32 KB).