Benchmarks: Improve autoscaling and add a benchmark for subscripting#7454
Merged
scoder merged 18 commits intocython:masterfrom Jan 9, 2026
Merged
Benchmarks: Improve autoscaling and add a benchmark for subscripting#7454scoder merged 18 commits intocython:masterfrom
scoder merged 18 commits intocython:masterfrom
Conversation
…st benchmark instead of the slowest. Scale back the timings of sub-benchmarks to the outer scale count to report comparable timings.
…ed, and also time the subscripting from Python.
… run. This gives quicker insights long before the complete results are printed at the end of the run.
Contributor
Author
|
Merging this to make use of it in my other PRs. |
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.
While working on the subscript benchmark, I noticed that the autoscaling (originally copied from Python's timeit command) often misbehaved for short-running benchmarks. Here's a better and faster implementation.
I also improved the overall reporting by scaling the separately adjusted sub-benchmark results back to the overall scale for the benchmark module.
To make use of new features in newer Cython versions, I added a way to mark code lines
as "version x.y+ only" and comment them out otherwise.
And I improved the output of errors and warnings and started showing the timings as early as possible to give an idea of the behaviour without waiting for the whole run to finish.