Repository navigation
fix: divide walltime round times as floats to keep sub-nanosecond precision - #214
Open
JeetuSK0808 wants to merge 1 commit into
Open
JeetuSK0808 wants to merge 1 commit into
JeetuSK0808 wants to merge 1 commit into
Conversation
…cision from_runtime_data divided each round's u128 time by its u128 iteration count, so the time per iteration was floored to a whole nanosecond before the stats were computed. A 1.7 ns/iter benchmark was reported as 1 ns and anything under 1 ns as 0 ns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Medium impact] The PR appears safe to merge. SummaryPreserves fractional nanoseconds by converting round times and iteration counts to
Reviews (1) · Last reviewed commit: "fix: divide walltime round times as floa..." · Reviewed by Greptile |
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.
WalltimeBenchmark::from_runtime_datadivides each round's time by its iteration count with both sidesu128, so the time per iteration is floored to a whole nanosecond before the mean, median, min, max, stdev and quartiles are computed. A 1.7 ns/iter criterion or divan benchmark shows up as 1 ns, and anything under 1 ns shows up as 0.This divides as
f64instead. Rounds whose time divides evenly give exactly the same stats as before, andtotal_timeanditer_per_roundare unchanged.Tests
walltime_results.rs: a 1.7 ns/iter benchmark keeps 1.7, and a 0.4 to 0.6 ns/iter one is no longer reported as 0. Both fail onmain.cargo test -p codspeed: 11 passed onmain, 13 with this change.cargo fmt --checkandcargo clippyare clean.Based on
main. #205 edits the same function and keeps the integer division as a context line.I used Claude Code to find and check this.
Generated with Claude Code