Repository navigation
perf(duplex): partition strand groups by move instead of cloning - #424
Conversation
`process_group` split the alignment-filtered `filtered_xs` / `filtered_ys` back into the four strand groups (AB-R1, AB-R2, BA-R1, BA-R2) with four `iter().filter(...).cloned().collect()` passes, deep-cloning every surviving `SourceRead` (its bases, quals, and two cigar vecs) once per duplex template. The two splits of each vec are disjoint partitions on a single flag bit (`FIRST_SEGMENT` set vs clear), so use `into_iter().partition(...)` to move each read into its group in one pass with no clones. Partition preserves per-group order, so the consensus output is unchanged.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat-runall #424 +/- ##
==============================================
Coverage ? 93.31%
==============================================
Files ? 139
Lines ? 54920
Branches ? 0
==============================================
Hits ? 51249
Misses ? 3671
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
1 similar comment
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughIn 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
`process_group` split the alignment-filtered `filtered_xs` / `filtered_ys` back into the four strand groups (AB-R1, AB-R2, BA-R1, BA-R2) with four `iter().filter(...).cloned().collect()` passes, deep-cloning every surviving `SourceRead` (its bases, quals, and two cigar vecs) once per duplex template. The two splits of each vec are disjoint partitions on a single flag bit (`FIRST_SEGMENT` set vs clear), so use `into_iter().partition(...)` to move each read into its group in one pass with no clones. Partition preserves per-group order, so the consensus output is unchanged.
Wave 1 perf cleanup (#3 of the feat-runall review series).
What
process_groupsplit the alignment-filteredfiltered_xs/filtered_ysback into the four strand groups (AB-R1, AB-R2, BA-R1, BA-R2) with fouriter().filter(...).cloned().collect()passes — deep-cloning every survivingSourceRead(its bases, quals, and two cigar vecs) once per duplex template.The two splits of each vec are disjoint partitions on a single flag bit (
FIRST_SEGMENTset vs clear), so this moves each read into its group withinto_iter().partition(...)in one pass, no clones.Behavior
Unchanged. The partition predicates map 1:1 to the original four filters, and
partitionpreserves per-group iteration order, so consensus output is identical.Verification
cargo ci-fmt/cargo ci-lint(clippy pedantic) clean.cargo nextest -E 'test(duplex)'— 91 tests pass, includingrunall_duplex_record_stream_is_deterministic, the fgbio-parity duplex tests, andtest_duplex_metrics_command::*.--agent) and a CodeRabbit-style self-review: 0 findings.