-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: lib.generate_slices #42097
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
PERF: lib.generate_slices #42097
Conversation
@meeseeksdev backport 1.3.x |
thanks @mzeitlin11 |
Something went wrong ... Please have a look at my logs. |
start += group_size | ||
group_size = 0 | ||
|
||
return np.asarray(starts), np.asarray(ends) |
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.
FYI there is a tiny perf bump from using starts.base
instead of np.asarray(starts)
in these cases.
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.
Ah thanks, good to know
Co-authored-by: Matthew Zeitlin <[email protected]>
Master:
1.86 ms ± 44 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
This pr:
859 µs ± 127 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
Adding the
cython
decorators makes a huge difference here