Skip to content

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

Open
cbueth wants to merge 2 commits into
mainfrom
perf/throttle-progress
Open

perf(progress): throttle print_progress to 1 Hz instead of every pair#50
cbueth wants to merge 2 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 improve performance by 18.46%

⚡ 1 improved benchmark
✅ 27 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
test_ordinal_patterns 15.9 ms 13.4 ms +18.46%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing perf/throttle-progress (6e35d25) with main (875adcd)

Open in CodSpeed

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