Repository navigation
perf: fast_regex: store literal needles in an Arc - #604
Conversation
re_or_saved_re() (src/sed/processor.rs:192) copies the regex for every input line. With an Arc<[u8]>, that copy shares the existing pattern instead of allocating a new one.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #604 +/- ##
=======================================
Coverage 94.85% 94.85%
=======================================
Files 14 14
Lines 7230 7230
Branches 432 432
=======================================
Hits 6858 6858
Misses 371 371
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will regress 1 benchmark
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | number_fix |
1.2 s | 1.3 s | -3.62% |
| ⚡ | remove_cr |
502.9 ms | 432.7 ms | +16.23% |
| ⚡ | access_log_no_del |
1,042.8 ms | 900 ms | +15.88% |
| ⚡ | access_log_no_subst |
1,052.1 ms | 908.8 ms | +15.77% |
| ⚡ | access_log_all_del |
1,075 ms | 932.2 ms | +15.33% |
| ⚡ | genome_subst |
432.1 ms | 389.9 ms | +10.83% |
| ⚡ | access_log_subst |
2.2 s | 2.2 s | +3.14% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing Omkar-Wagholikar:perf/literal-needle-arc (2fc8b9d) with main (58608af)
|
Thanks for your PR |
re_or_saved_re() (src/sed/processor.rs:192) copies the regex for every input line. With an Arc<[u8]>, that copy shares the existing pattern instead of allocating a new one.
I have not added tests specifically for this change as there is not net behavior change only a perf update, and the existing tests cover the changes as well