fix(bench): improve benchmark stability and output formatting#2597
Merged
iduartgomez merged 2 commits intomainfrom Jan 5, 2026
Merged
fix(bench): improve benchmark stability and output formatting#2597iduartgomez merged 2 commits intomainfrom
iduartgomez merged 2 commits intomainfrom
Conversation
This commit consolidates multiple improvements to the benchmark infrastructure: Benchmark Stability Fixes: - Use small warmup messages (1000 bytes) to avoid cwnd exhaustion - Add proper error handling in all benchmark functions - Increase measurement times to collect sufficient samples - Fix doc comment warnings (/// -> //) on criterion macros Parser Improvements (parse_bench_output.py): - Fix time extraction to properly get middle value with unit - Add benchmark name validation (must contain '/') - Filter out criterion output lines from benchmark name detection - Add severe regression detection (>25% on throughput benchmarks) - Exit code 2 for severe regressions, 1 for regular regressions CI Workflow Updates: - Add "Fail on Severe Regressions" step for nightly/main builds - Parse exit codes to distinguish severity levels - PRs get informational comments only, not failures New Benchmarks: - Add RTT scenario benchmarks (0ms, 5ms, 10ms, 25ms, 50ms delays) Removed: - transport_direct.rs (redundant after criterion fixes)
403e0ce to
337a18a
Compare
Document known gaps in transport benchmark coverage that could allow regressions to go undetected: Critical gaps: - Memory usage tracking (none) - Bidirectional simultaneous transfer (none) - Connection churn / many short connections (none) - High RTT paths 100ms+ (partial - only up to 50ms) Medium priority gaps: - Timeout/retransmission behavior (indirect only) - Multiple concurrent connections from different peers - Backpressure / flow control behavior Also documents potential for virtual time benchmarks using Criterion's custom Measurement trait, which could make high-RTT and timeout testing 10-100x faster.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes three issues with benchmark reports:
ANSI escape codes in output - Cargo warnings with color codes were
polluting markdown reports. Fixed by:
Benchmark panic during warmup - ConnectionClosed errors in warmup
phase caused benchmark crashes. Fixed by:
of panicking on errors
Extended benchmarks not running - transport_extended was missing from
Cargo.toml [[bench]] configuration, causing cargo to run test harness
instead of criterion. Fixed by adding proper bench configuration with
harness = false.