Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output geometric mean to 0.1% precision #126

Closed
wants to merge 2 commits into from

Conversation

brandtbucher
Copy link

Closes #123.

@brandtbucher
Copy link
Author

CC @vstinner

@vstinner
Copy link
Member

Do you really care of a difference smaller than 1%?

Could it be an option? I would prefer to display least digits as possible for the most common use cases.

@@ -39,9 +39,9 @@ def format_normalized_mean(norm_mean):
if norm_mean == 1.0:
return "no change"
elif norm_mean < 1.0:
return "%.2fx faster" % (1.0 / norm_mean)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe leave this as it is, but take a precision argument (which can default to 2).

Then in format_geometric_mean() call format_normalized_mean(geo_mean, 3)

@vstinner
Copy link
Member

vstinner commented Jun 6, 2022

If possible, I would prefer to keep 2 digits after the dot ("1.02x faster") for benchmarks. Otherwise, people will fight to death for a digit which is not significant and means nothing. People often misunderstand and misread benchmark results. Maybe pyperf default output should be simplified to not digits :-D Only say: faster, slower or not significant ;-)

By the way, IMO pyperf should say "not significant" in more cases ;-)

But I'm open to the idea of adding a 3rd digit after the dot for the geometric mean which cumulates results of multiple benchmarks.

pyperf stores all data in JSON. pyperf can have many options to change the formatting of the output. Maybe it can be a command line option to show "more digits". How many? I don't know.

I am fine with adding options, people are free to use data as they want. I mostly care about keeping the default formatting unchanged to not open discussions about the least significant digit which is usually not significant.

It's hard to draw a line between "significant digit" and "not significant digit". It depends on the duration of a single benchmark run, the kind of benchmark, etc. pyperf knows little about the benchmark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output geometric mean to 0.1% precision
4 participants