-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: IndexEngine.get_indexer_non_unique #55816
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
How would performance be if scaling followed 10000 + 2^n where 2^n was about 10000 on the first iteration? |
I tried 10000 + 2^n starting with n=13 (8192) which produced the following timings for the two examples above:
Pretty close to the timings in this PR. Let me know if you prefer to use this. |
If the resizing is the expensive operation here, I think this would be generically more performant for larger cases too so yes |
If I understand correctly, I think your suggestion is very close to the current PR as they both end up growing by a factor of 2:
Am I understanding your suggestion correctly? |
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. I don't think the heuristic for this will make too much of a difference. See also https://stackoverflow.com/questions/3190146/is-it-better-to-allocate-memory-in-the-power-of-two
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 I see. Yeah what you have is sufficient in this case (and less complex than what I proposed)
Thanks @lukemanley |
doc/source/whatsnew/v2.2.0.rst
file if fixing a bug or adding a new feature.maybe(?) closes #15364
When resizing result array, grow by factor of 2 rather than fixed amount.