Comments (1)
Nice find! There was indeed a pretty big perf regression since I last checked (which has been quite some time by now). Before your fix:
test bench::anchored_literal_long_match ... bench: 562 ns/iter (+/- 18)
test bench::anchored_literal_long_non_match ... bench: 158 ns/iter (+/- 0)
test bench::anchored_literal_short_match ... bench: 564 ns/iter (+/- 7)
test bench::anchored_literal_short_non_match ... bench: 158 ns/iter (+/- 0)
test bench::easy0_1K ... bench: 2515 ns/iter (+/- 132) = 407 MB/s
test bench::easy0_32 ... bench: 62 ns/iter (+/- 1) = 516 MB/s
test bench::easy0_32K ... bench: 81260 ns/iter (+/- 576) = 403 MB/s
test bench::easy1_1K ... bench: 5593 ns/iter (+/- 3725) = 183 MB/s
test bench::easy1_32 ... bench: 118 ns/iter (+/- 515) = 271 MB/s
test bench::easy1_32K ... bench: 193004 ns/iter (+/- 19035) = 169 MB/s
test bench::hard_1K ... bench: 172947 ns/iter (+/- 343) = 5 MB/s
test bench::hard_32 ... bench: 5620 ns/iter (+/- 48) = 5 MB/s
test bench::hard_32K ... bench: 5535176 ns/iter (+/- 87371) = 5 MB/s
test bench::literal ... bench: 229 ns/iter (+/- 0)
test bench::match_class ... bench: 4211 ns/iter (+/- 88)
test bench::match_class_in_range ... bench: 4202 ns/iter (+/- 23)
test bench::medium_1K ... bench: 149129 ns/iter (+/- 1082) = 6 MB/s
test bench::medium_32 ... bench: 4849 ns/iter (+/- 64) = 6 MB/s
test bench::medium_32K ... bench: 4759628 ns/iter (+/- 85867) = 6 MB/s
test bench::no_exponential ... bench: 268274 ns/iter (+/- 474)
test bench::not_literal ... bench: 2944 ns/iter (+/- 17)
test bench::one_pass_long_prefix ... bench: 4176 ns/iter (+/- 10)
test bench::one_pass_long_prefix_not ... bench: 4180 ns/iter (+/- 10)
test bench::one_pass_short_a ... bench: 3150 ns/iter (+/- 19)
test bench::one_pass_short_a_not ... bench: 3319 ns/iter (+/- 9)
test bench::one_pass_short_b ... bench: 2044 ns/iter (+/- 12)
test bench::one_pass_short_b_not ... bench: 2307 ns/iter (+/- 15)
test bench::replace_all ... bench: 2187 ns/iter (+/- 4)
After your fix:
test bench::anchored_literal_long_match ... bench: 178 ns/iter (+/- 1)
test bench::anchored_literal_long_non_match ... bench: 64 ns/iter (+/- 0)
test bench::anchored_literal_short_match ... bench: 178 ns/iter (+/- 1)
test bench::anchored_literal_short_non_match ... bench: 64 ns/iter (+/- 0)
test bench::easy0_1K ... bench: 2511 ns/iter (+/- 81) = 407 MB/s
test bench::easy0_32 ... bench: 61 ns/iter (+/- 1) = 524 MB/s
test bench::easy0_32K ... bench: 81274 ns/iter (+/- 771) = 403 MB/s
test bench::easy1_1K ... bench: 2999 ns/iter (+/- 860) = 341 MB/s
test bench::easy1_32 ... bench: 118 ns/iter (+/- 119) = 271 MB/s
test bench::easy1_32K ... bench: 95742 ns/iter (+/- 4641) = 342 MB/s
test bench::hard_1K ... bench: 36505 ns/iter (+/- 330) = 28 MB/s
test bench::hard_32 ... bench: 1196 ns/iter (+/- 24) = 26 MB/s
test bench::hard_32K ... bench: 1166028 ns/iter (+/- 3484) = 28 MB/s
test bench::literal ... bench: 203 ns/iter (+/- 2)
test bench::match_class ... bench: 1633 ns/iter (+/- 4)
test bench::match_class_in_range ... bench: 1656 ns/iter (+/- 4)
test bench::medium_1K ... bench: 19639 ns/iter (+/- 244) = 52 MB/s
test bench::medium_32 ... bench: 667 ns/iter (+/- 46) = 47 MB/s
test bench::medium_32K ... bench: 627499 ns/iter (+/- 1669) = 52 MB/s
test bench::no_exponential ... bench: 274265 ns/iter (+/- 512)
test bench::not_literal ... bench: 1132 ns/iter (+/- 3)
test bench::one_pass_long_prefix ... bench: 609 ns/iter (+/- 3)
test bench::one_pass_long_prefix_not ... bench: 614 ns/iter (+/- 2)
test bench::one_pass_short_a ... bench: 1153 ns/iter (+/- 11)
test bench::one_pass_short_a_not ... bench: 1439 ns/iter (+/- 13)
test bench::one_pass_short_b ... bench: 785 ns/iter (+/- 4)
test bench::one_pass_short_b_not ... bench: 1049 ns/iter (+/- 5)
test bench::replace_all ... bench: 1190 ns/iter (+/- 4)
These latter benchmarks line up closely with what I recorded last year (scroll to bottom).
Thanks! :D I uploaded this fix to regex_macros
in version 0.1.18
on crates.io.
from regex.
Related Issues (20)
- UnicodeSetsMode support (`v` flag mode, `\q`) HOT 9
- Detect if a replacement may allocate HOT 3
- Add method to get full match from `Captures` HOT 3
- Have a way to iterate over sub matches with names included HOT 1
- O(m * n) lookaround
- `meta::Cache::reset` can panic
- Add Min DFA for a regex HOT 23
- Inconsistent behavior with zero-width matches on empty strings
- Valid prefix search (with ^) goes into dead state HOT 3
- The regex parse error while the expre is correct ! HOT 2
- Onepass DFA always has empty captures (user error) HOT 2
- dfa/onepass.rs: index out of bounds HOT 2
- Errors when running quickstart from docs HOT 2
- Add a flag for unescaped literal groups HOT 1
- Inconsistency with is_match and Python's search in Matching Specific Regex Patterns HOT 6
- regex-lite with a &[u8] haystack HOT 2
- Underscore will not match propblaly HOT 2
- Invalid regex with multiple repetition flags is accepted HOT 3
- Valgrind reports "possibly lost" when using static `Regex` HOT 7
- adding regex-automata to cargo.toml file reduces performance
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from regex.