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) #1100

Merged
merged 1 commit into from
Feb 21, 2024

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)
@coveralls
Copy link

Pull Request Test Coverage Report for Build 7979161840

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 6 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.6%) to 96.568%

Files with Coverage Reduction New Missed Lines %
src/shortest_path/all_pairs_bellman_ford.rs 6 95.53%
Totals Coverage Status
Change from base Build 7680924114: 0.6%
Covered Lines: 16740
Relevant Lines: 17335

💛 - Coveralls

@IvanIsCoding
Copy link
Collaborator

@mtreinish For some reason this PR is hanging because it is waiting for a Python 3.7 CI status. Which clearly will not happen because we deleted it!

@mtreinish
Copy link
Member

I had to update the branch protection rules for the stable branch as they were still setup for stable/0.13.

@mtreinish mtreinish merged commit d1f0a1c into stable/0.14 Feb 21, 2024
25 checks passed
@mtreinish mtreinish deleted the mergify/bp/stable/0.14/pr-1096 branch February 21, 2024 12:05
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.

None yet

4 participants