[MOD-10084] port metric iterator to rust#6983
Conversation
…beng-rust-metric-iterator
…beng-rust-metric-iterator
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #6983 +/- ##
==========================================
- Coverage 85.41% 85.15% -0.26%
==========================================
Files 337 340 +3
Lines 51920 52234 +314
Branches 11848 12157 +309
==========================================
+ Hits 44345 44480 +135
- Misses 7390 7566 +176
- Partials 185 188 +3
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:
|
0b6783c to
ecc8157
Compare
The Rust implementation is significantly slower than the C one. I'm pretty sure it's because of the 2 ffi calls in I did some profiling and indeed we see most of the time is spent there.
So I'm afraid there is not much we can do at this point. The best way to solve this would be enable C/Rust LTO (MOD-10751) and/or to port I'd suggest we merge this for now and open another task reminding us to re-check performance once progress has been made on those other fronts. @GuyAv46 : what do you think? |
|
@gdesmott do we know why we need all the C mocks in the test? |
No, but it seems it's not a new problem with coverage, see https://github.com/RediSearch/RediSearch/blob/master/build.sh#L576 I hope we'll find soon a better way to manage C code from Rust tests and benches. |
Opened MOD-12235 for this. |


add the metric iterator implementation in rust
Note
Introduces a Rust Metric iterator (with C interop), updates IdList helpers, exposes metric reset/array length symbols, and adds tests/benchmarks plus minor build/linking tweaks.
metric::Metriciterator yielding metric results and attachingRSYieldableMetricvalues.id_list::IdListwithread_and_get_offset/skip_to_and_get_offsetto support metric iterator.tests/metric.rs) with C symbol mocks; feature-gated build script linksarrfor tests.benches/iterators.rs.QueryIterator::new_metricand required symbols.ResultMetrics_Reset_func(RSIndexResult*)and bind it in Rust (inverted_indexre-exports).array_len_funcinutil/arrand includearr.hin Rust FFI bindings; add C++ test for it.build.sh, on non-macos add-C link-args=-lgcovfor coverage; minor RUSTFLAGS invocation tweak.Written by Cursor Bugbot for commit ce7e57e. This will update automatically on new commits. Configure here.