Fix stats printing for floats and negative deltas#357
Merged
Conversation
5d2dc4c to
3bc4100
Compare
maximecb
reviewed
Jan 22, 2025
harness/harness.rb
Outdated
Comment on lines
63
to
70
| # Insert comma separators but only in the whole number portion. | ||
| diff = (new_value - old_value).to_s.split(".").tap do |a| | ||
| # Preserve any leading minus sign that may be on the beginning. | ||
| a[0] = a[0].reverse.scan(/\d{1,3}-?/).join(",").reverse | ||
| # Add a space when positive so that if there is ever a negative | ||
| # the first digit will line up. | ||
| a[0].prepend(" ") unless a[0].start_with?("-") | ||
| end.join(".") |
Contributor
There was a problem hiding this comment.
Might be code to put this in a utility function
Contributor
Author
There was a problem hiding this comment.
Sure. I hesitated because we've talked before about how additional definitions in the global env can have an affect on the benchmark, but it would allow us to reuse it in the other location
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.
This allows tracking ratio_in_yjit which was previously printing as
ratio_in_yjit: 97,01,453,835,082,627.