Skip to content

RangeSetND: avoid quadratic padding scan in iter_padding() - #706

Open
thiell wants to merge 1 commit into
clustershell:masterfrom
thiell:cleanup/iter-padding
Open

RangeSetND: avoid quadratic padding scan in iter_padding()#706
thiell wants to merge 1 commit into
clustershell:masterfrom
thiell:cleanup/iter-padding

Conversation

@thiell

@thiell thiell commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator
  • RangeSet.padding is a property that walks the whole set; computing it for each yielded item made iter_padding() quadratic on large sets.
  • Compute it once per vector instead; each item still gets its own list (contract now covered by a new test).
  • Docstring now suggests pads() when per-item padding info is not needed.

RangeSet.padding is a property that walks the whole set, so computing
it for each yielded item made iter_padding() quadratic. Compute it
once per vector instead; each item still gets its own list. Point to
the faster pads() in the docstring.

Signed-off-by: Stephane Thiell <[email protected]>
@thiell thiell added this to the 1.11 milestone Aug 5, 2026
@thiell
thiell requested a review from degremont August 5, 2026 12:20
@thiell thiell self-assigned this Aug 5, 2026
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.

1 participant