Skip to content

Add Replace and GlobalReplace performance benchmarks to regex - #78

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_967697691
Aug 20, 2026
Merged

Add Replace and GlobalReplace performance benchmarks to regex#78
copybara-service[bot] merged 1 commit into
mainfrom
test_967697691

Conversation

@copybara-service

Copy link
Copy Markdown

Add Replace and GlobalReplace performance benchmarks to regex

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).

@copybara-service
copybara-service Bot force-pushed the test_967697691 branch 4 times, most recently from e4da6e7 to b8ff4ea Compare August 20, 2026 11:49
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
copybara-service Bot merged commit 9863b39 into main Aug 20, 2026
@copybara-service
copybara-service Bot deleted the test_967697691 branch August 20, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant