Skip to content

perf(progress): throttle print_progress to 1 Hz instead of every pair - #50

Merged
cbueth merged 4 commits into
mainfrom
perf/throttle-progress
Aug 3, 2026
Merged

perf(progress): throttle print_progress to 1 Hz instead of every pair#50
cbueth merged 4 commits into
mainfrom
perf/throttle-progress

Conversation

@cbueth

@cbueth cbueth commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Previously print_progress was called after every single pair, flushing stdout each time. For a 100-node network that's 9,900 flushes. significant stdbuf overhead.

Replace with rate-limited output: print at most once per second, with a final forced print on the last pair. Applies to both sequential and parallel paths.

Mechanism: track last_print timestamp; only call print_progress when at least 1 second has elapsed (or it's the final pair). Uses Manager.Value in the parallel path for cross-process sharing.

@cbueth cbueth self-assigned this Jul 30, 2026
@cbueth cbueth added the enhancement New feature or request label Jul 30, 2026
@codspeed-hq

codspeed-hq Bot commented Jul 30, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 28.1%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 27 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
test_detrend_method[z_score-p10] 1.2 ms 1.7 ms -28.1%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing perf/throttle-progress (9e22ecd) with main (8119494)

Open in CodSpeed

cbueth added 3 commits July 30, 2026 20:03
Pass the new last_print shared value to _compute_with_progress and add parametrized tests covering the 1 Hz throttle branches in both the sequential and parallel paths. Extract a shared-memory helper to avoid repeating setup code.
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (8119494) to head (9e22ecd).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #50   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           29        29           
  Lines          851       859    +8     
  Branches       147       149    +2     
=========================================
+ Hits           851       859    +8     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cbueth
cbueth merged commit 416b7a7 into main Aug 3, 2026
10 of 12 checks passed
@cbueth
cbueth deleted the perf/throttle-progress branch August 3, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant