-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: tighter cython declarations, faster __iter__ #43872
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
Conversation
jbrockmendel
commented
Oct 4, 2021
- closes #xxxx
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Are the ndim=1
additions for readability or performance? Have always just assumed (but never checked) that cython
infers it. If it helps perf we should do it everywhere - a quick regex shows lots of places we don't use ndim=1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
can you post benchmark changes in the top |
When I was working on this I convinced myself that it made a difference, but I can no longer remember why. Maybe @da-woods can weigh in?
It's all going to be micro-perf that asvs don't pick up well |
https://cython.readthedocs.io/en/latest/src/tutorial/numpy.html#efficient-indexing
I had a quick test of a simple example (looking at the annotated source) and the behaviour looks to match what the docs say. So I think there's no performance advantage to specifying |
Thanks @da-woods. If the |