[Refactor] StreamingProducer: use VecDeque for O(1) buffer advance
Maintainers usually reply within 2 days
@andrewmusselman is already working on this.
Since Oct 20, 2026.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 70/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- rust
- Domain
- performance, stream-processing
Research direction
Start in qdp-core/src/pipeline_runner.rs:368 and inspect the StreamingProducer buffer initialization and advance path, including whether StreamingAdapter has landed. Run the streaming coverage in tests/parquet_f32.rs and tests/reader.rs before changes. Done means the buffer uses VecDeque, capacity stays bounded across 100 batches, output remains identical, and advancement avoids per-batch O(n) memmoves.
Written by the indexing model from the issue text.
Description
What
Change the streaming producer's internal buffer from a Vec advanced with Vec::drain(..cursor) to a VecDeque, so advancing past consumed samples is O(1) instead of O(n).
Why
StreamingProducer currently advances its buffer with self.buffer.drain(..self.buffer_cursor) (qdp-core/src/pipeline_runner.rs:368), which memmoves the remaining elements down on every batch — O(n) per advance, paid on the streaming hot path. A VecDeque makes front-popping O(1) and avoids the repeated memmove, with no change to the data produced.
How
- Replace the backing
Vecbuffer in the streaming producer (orStreamingAdapter, if E2 has landed) with aVecDeque<T>. - Swap the
Vec::drain(..cursor)front-removal forVecDequefront operations (drain(..cursor)/pop_front) so the advance is O(1) amortized. - Ensure capacity stays bounded across many batches (no unbounded growth or reallocation churn).
- Keep output identical to the current streaming path.
Out of scope: Producer unification (E2) if taken separately, any change to streaming correctness or output.
Acceptance criteria:
- Test:
VecDequecapacity stays constant over 100 consecutive batches (no reallocation growth) - No correctness change on the streaming coverage in
tests/parquet_f32.rsandtests/reader.rs - Streaming hot-path advance is O(1) (no per-batch O(n) memmove)
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 1k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 7
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/mahout
-
[Bug] Amazon Braket get_final_state_vector() changes the circuit, so execute_circuit() fails afterwardsPossibly taken @Howardisme claimed this 48 days ago. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
apache/mahout#1538 · 1 comment ·
Maintainers usually reply within 2 days
-
[Bug] Reusing a parameter name on two gates fails on Qiskit only (name conflict adding parameter)Possibly taken @Imad2702 claimed this 50 days ago. Openbug enhancement good-first-issue qumat
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/mahout#1509 · 2 comments ·
Maintainers usually reply within 2 days
-
[Bug] Cirq backend ignores the initialized simulator and creates its own cirq.Simulator()Possibly taken @Howardisme claimed this 49 days ago. Openbug enhancement good-first-issue qumat
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
apache/mahout#1508 · 1 comment · 1 assignee ·
Maintainers usually reply within 2 days
-
[Bug] Unknown backend_name leaks ModuleNotFoundError instead of a clear ValueErrorPossibly taken @Asterisk-Hunter claimed this 38 days ago. Openbug enhancement good-first-issue qumat
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
apache/mahout#1506 · 5 comments ·
Maintainers usually reply within 2 days
-
bug docs enhancement question
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 2 days
Similar issues
-
chat compiler P1
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
HerringtonDarkholme/hd-lang#2793 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
security-advisory
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
MinBZK/regelrecht#2173 ·
-
ci
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
jonathanong/no-mistakes#5804 ·
-
triage: failed
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
oxc-project/tsrs#1277 · 1 comment ·
Maintainers usually reply within 1 day