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
timeit: use powers of 2 in autorange(), instead of powers of 10 #72655
Comments
In the issue bpo-28240, I changed the default repeat from 3 to 5 in timeit. Serhiy wrote (msg277157): "For now default timeit run takes from 0.8 to 8 sec. Adding yet 5 sec makes a user more angry." I propose to use powers to 2, instead of powers of 10, in timeit autorange to reduce the total duration of the microbenchmark.
|
"131072 loops" in a report looks not human friendly. I would prefer using a sequence of round numbers: 1, 2, 5, 10, 20, 50, 100, ... |
In my perf module, I use 2^n syntax for numbers larger than 1024. Syntax accepted in command line arguments. |
The perf module doesn't report the number of loops by default. |
Right, it's hidden by default. I consider that it's not an useful information for end users. If you want more details (see the number of inner and outer loops), use --verbose ("python3 -m perf timeit -v ...") or the stats commands ("python3 -m perf stats file.json"). |
Following patch takes numbers from the sequence 1, 2, 5, 10, 20, 50, ... It also updates the documentation and tests. |
timeit_autorange_numbers.patch: LGTM. |
New changeset 8e6cc952adc6 by Serhiy Storchaka in branch 'default': |
Misc/NEWS
so that it is managed by towncrier #552Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: