-
-
Notifications
You must be signed in to change notification settings - Fork 44
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(core): binary search for findIndex #493
Conversation
5249b36
to
2491d1e
Compare
Update src/core/cache.ts remove formatting commas an prefer slice wip
4d2778c
to
7b4a903
Compare
@inokawa I made some updates I thought were sensible, mind taking a look? If you're okay with these changes, I'll update the tests - or I can revert back to the previous behavior.
|
204172a
to
a3823b9
Compare
Could you fix the logic so that the tests pass? |
a3823b9
to
e3b5753
Compare
I went ahead and reverted those changes. I think there will either need to be a breaking change or more complex logic to meet the test criteria than is probably worth to change the return value of |
Friendly ping on this so it doesn't get out of date with main. @inokawa Do you have anything you'd like me to change or test before merging in? |
Thank you for pinging! Basically I think it's ok if PR passes all of the current tests because they cover the most of edge cases. However I'd like to check it later when I have time, to publish it without any regression. |
👋🏼 Hello again! I don't mean to be a bother but would like to see this merged. Is there anything I can do to help test to get the level of confidence required for a merge? I ran the storybook and tested a quite a few of the stories without issue but IDK if there is something specific you'd like to test. Happy to help wherever I can, I know it is very time consuming maintaining OSS! |
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.
Thanks! And sorry for my late reply.
This is a quick win that should help with
findIndex
performance. RE: #488Here are a few benchmarks that I ran to get an idea of the perf diff (MS averaged over 10,000 iterations)
Cache size: 10k | Item size: 90 | offsetToFind: 5000
Cache size: 1,000 | Item size: 45 | offsetToFind: 900
Cache size: 100 | Item size: 15 | offsetToFind: 99