Skip to content

Benchmarks: Improve autoscaling and add a benchmark for subscripting#7454

Merged
scoder merged 18 commits intocython:masterfrom
scoder:getitem_bench
Jan 9, 2026
Merged

Benchmarks: Improve autoscaling and add a benchmark for subscripting#7454
scoder merged 18 commits intocython:masterfrom
scoder:getitem_bench

Conversation

@scoder
Copy link
Copy Markdown
Contributor

@scoder scoder commented Jan 9, 2026

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.

@scoder scoder added this to the 3.3 milestone Jan 9, 2026
@scoder scoder added the Testing label Jan 9, 2026
@scoder
Copy link
Copy Markdown
Contributor Author

scoder commented Jan 9, 2026

Merging this to make use of it in my other PRs.

@scoder scoder merged commit a45d065 into cython:master Jan 9, 2026
82 checks passed
@scoder scoder deleted the getitem_bench branch January 9, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant