Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance of custom-iterator __getitem__ (backport #1096) #1097

Closed
wants to merge 1 commit into from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Feb 20, 2024

This is an automatic backport of pull request #1096 done by Mergify.


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

Flipping the order of `Slice` and `Int` in `SliceOrInt` so that `Int`
comes first means that the `FromPyObject` derivation will then try `Int`
first, which is the correct variant in like 99.9% of uses of the struct.
This has the impact of improving int `__getitem__` times in the custom
iterators by about 3x (from 205ns to 61ns on my machine), which has
knock-on effects for the implicit iterators Python defines for these
classes.

(cherry picked from commit d4f28e3)
@mtreinish mtreinish closed this Feb 20, 2024
@mergify mergify bot deleted the mergify/bp/stable/0.13/pr-1096 branch February 20, 2024 19:48
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