Repository navigation
perf(progress): fast-path log_if_needed via cached next threshold - #345
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #345 +/- ##
=======================================
Coverage 90.97% 90.97%
=======================================
Files 78 78
Lines 51017 51017
=======================================
+ Hits 46412 46413 +1
+ Misses 4605 4604 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
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)
📝 WalkthroughHidden review stack artifact:WalkthroughProgressTracker adds an atomic 🚥 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 |
✅ Actions performedReview triggered.
|
18ba353 to
77009a9
Compare
… path The fast path now compares `count` against a cached `next_threshold` instead of dividing by `interval`, saving ~30-60 cycles per call. At ~32 M `log_if_needed(1)` calls/s on a 16-thread sort, this is ~1 % of total CPU in profiles. Marked the slow path `#[cold]` and re-reads `next_threshold` under the EMA mutex so concurrent crossings can't double-log.
9ed3d21 to
5fb46c8
Compare
|
@coderabbitai resume |
|
@coderabbitai review |
✅ Actions performedReviews resumed. |
✅ Actions performedReview triggered.
|
|
@coderabbitai resume |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
✅ Actions performedReviews resumed. |
|
@coderabbitai resume |
|
@coderabbitai review |
✅ Actions performedReviews resumed. |
✅ Actions performedReview triggered.
|
|
@coderabbitai resume |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
✅ Actions performedReviews resumed. |
|
@coderabbitai resume |
|
@coderabbitai review |
✅ Actions performedReviews resumed. |
✅ Actions performedReview triggered.
|
Stacked on #344.
Summary
intervalcheck inProgressTracker::log_if_neededwith a comparison against a cachednext_threshold, saving ~30-60 cycles per call.#[cold]and re-readnext_thresholdunder the EMA mutex so concurrent crossings can't double-log.Why
log_if_needed(1)is called once per record on hot BAM paths. On a 16-thread sort at ~32 M calls/s this branch shows up as ~1 % of total CPU in profiles. The thresholds form a fixed arithmetic sequence, so caching the next one removes the division entirely on the predicted-not-taken fast path.Test plan
cargo ci-testcargo ci-fmt && cargo ci-lint