[MOD-10235] Polish varint implementation#6346
Conversation
85066e6 to
8259983
Compare
chesedo
left a comment
There was a problem hiding this comment.
Just small nit picky stuff
4330516 to
e76b5e9
Compare
e76b5e9 to
e32e4ca
Compare
e32e4ca to
bd64db5
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6346 +/- ##
==========================================
+ Coverage 88.72% 88.76% +0.04%
==========================================
Files 251 251
Lines 41729 41606 -123
Branches 3748 3625 -123
==========================================
- Hits 37022 36930 -92
+ Misses 4658 4632 -26
+ Partials 49 44 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| fn benchmark_core_operations(c: &mut Criterion) { | ||
| let bencher = VarintBencher::new("Varint".to_owned(), Duration::from_secs(10)); | ||
| let bencher = VarintBencher::new(Duration::from_secs(5)); |
There was a problem hiding this comment.
Is the change from 10 to 5 intentional?
There was a problem hiding this comment.
Yes, since the bench cases are now smaller we shouldn't need 10 seconds to achieve statistical significance.
I've just triggered a micro-benchmark run in CI to double-check that's the case in the CI environment too.
There was a problem hiding this comment.
I can confirm that the change doesn't cause issues, given the logs in https://github.com/RediSearch/RediSearch/actions/runs/15872068421/job/44750799229?pr=6346
Describe the changes in the pull request
This PR refactors the Rust varint implementation. There are no functional changes.
In particular:
FieldMask, and therefore on thefficrate, by providing an encoding/decoding implementation for bothu64andu128. We can thus stop mirroring in the varint test suite the platform-specific knobs that are used, on the C side, to pick the correct size ofFieldMask.encode_decodetovarint, since we want to have small self-contained crates to minimize compile times. The existingvarintcrate is renamed tovarint_ffi.Benchmarks
Benchmarks have been refactored to measure performance based on the expected encoded size, rather than grouping everything together.
You can compare performance before/after the refactoring by executing benches for the first commit on this branch and then re-running them for the latest commit on this branch. No significant changes were measured on my local machine.
Mark if applicable