Registry Mirror
Skip to content

Conversation

@headtr1ck

Copy link
Copy Markdown
Collaborator

Description

Since #11696 and #11900, rolling argmin/argmax with bottleneck spends about a third of its time removing the window padding from the indices, which makes the "Benchmark compare last release" job fail intermittently. bottleneck doesn't pad, so this PR computes its indices relative to the array directly, in the subtraction that already reversed them. Only the generic path still removes the padding.

  • time_rolling_long('argmax', ..., 'bottleneck'): 609/547 µs on main, 457/399 µs in v2026.09.0, 386/333 µs with this PR.
  • Rolling reductions with bottleneck now fall back to the generic path for windows larger than the array, which used to raise.
  • With dask, bottleneck used to raise when the first chunk, which isn't overlapped, was smaller than the window. Its windows are cut off by the start of the array, so it now uses the chunk's size as the window, without rechunking.
  • bottleneck results of dask arrays are no longer named after the dask array, e.g. _trim-<token>.

Checklist

  • Tests added
  • User visible changes (including notable bug fixes) are documented in whats-new.rst

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.
      Tools: Claude Code (Claude Opus 5.5)

🤖 Generated with Claude Code

headtr1ck and others added 2 commits November 21, 2026 00:20
Count bottleneck's indices from the first value of each window inside the
array directly, so that only the generic path needs to remove the padding.
Also fall back from bottleneck for windows larger than the array, apply
bottleneck to a first dask chunk that is shorter than the window, and don't
name the results of bottleneck after the dask array.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@headtr1ck headtr1ck added the run-benchmark Run the ASV benchmark workflow label Nov 20, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Some benchmarks got better. To infinity and beyond!

Change Before [5311351] After [213122b] Ratio Benchmark (Parameter)
🚀 558±10μs 343±10μs 0.62 rolling.Cumulative.time_cumulative('argmax', 'bottleneck')
🚀 222±6μs 126±4μs 0.57 rolling.Cumulative.time_cumulative('mean', 'bottleneck')
🚀 227±3μs 126±2μs 0.55 rolling.Cumulative.time_cumulative('sum', 'bottleneck')
🚀 290±20μs 184±4μs 0.63 rolling.Rolling.time_rolling_long('mean', False, 'bottleneck')

🚀 better · 🐌 worse · 💥 now failing · 🩹 fixed · 🤷 not comparable

Comparing 213122bf (this PR merged into the base branch) with 53113513 (base branch).
Only changes by more than a factor of 1.5 are shown, see the workflow run for all results.

@headtr1ck headtr1ck added the plan to merge Final call for comments label Nov 21, 2026
@headtr1ck
headtr1ck merged commit 9a2bdc9 into pydata:main Nov 22, 2026
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plan to merge Final call for comments run-benchmark Run the ASV benchmark workflow topic-dask topic-rolling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant