Skip to content

Conversation

@davidhewitt
Copy link
Member

Possibly more interesting after #5660 which will show if there is any benchmark improvement here :)

@davidhewitt
Copy link
Member Author

Seems like there is a minor performance loss in (e.g.) set iteration. Looks like the set iterator has a remaining variable, I think we don't need that overhead because PyObject_LengthHint returns the correct thing for a set iterator. I'll try to adjust later.

@davidhewitt
Copy link
Member Author

For generic iterators, this does seem to be slightly faster:

image

@davidhewitt davidhewitt marked this pull request as ready for review January 13, 2026 19:24
Copy link
Member

@bschoenmaeckers bschoenmaeckers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bschoenmaeckers bschoenmaeckers added this pull request to the merge queue Jan 13, 2026
Merged via the queue into PyO3:main with commit 95fd08e Jan 13, 2026
43 checks passed
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.

2 participants