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__ #1096

Merged
merged 1 commit into from
Feb 20, 2024

Commits on Feb 20, 2024

  1. Improve performance of custom-iterator __getitem__

    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.
    jakelishman committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    7a49961 View commit details
    Browse the repository at this point in the history