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

/// If an exception occurs, returns `Some(Err(..))`.
/// Further `next()` calls after an exception occurs are likely
/// to repeatedly result in the same exception.
#[inline]
Copy link
Member Author

Choose a reason for hiding this comment

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

Probably don't need this inlining hint any more?

Suggested change
#[inline]

@davidhewitt davidhewitt marked this pull request as draft November 30, 2025 10:19
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