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
Use native indexOf whenever possible #61
Conversation
This uses a windowing approach to determine how much of a buffer can be searched by the native indexOf when searching. It falls back to JS when it hits a boundary and if there is no available native search window. I'm pretty sure a BufferList can't be searched drastically faster than this. Actual performance needs to be measured.
I can't believe it's not obviously faster |
I think the bottleneck is something else. As you can see the length of the buffer is not impacting the measurements at all. Have you tried generating a flamegraph? You might also try varying the number of buffer in the list and see if that impacts the benchmarks at all. |
I think you're right. Running the new approach today
And now with new search init approach with less making of BL objects
So that's a lot better still not a great difference in time due to length. Flame graph has nothing obvious yet... |
I screwed up, These results make a lot more sense, this change is objectively better. // windowing approach
// old approach
The gist has the new perftest code. |
I think there is a huge performance cliff somewhere. Consider these two:
This is a 60x drop. I think it's overall better than the previous one anyway, but maybe this should be investigated. Do you plan to work more on this or we can land? |
Land, I'm still paying with profiling and other tools but it will be at
least a week before I can get back to any of this.
…On Sat, Oct 6, 2018, 4:20 PM Matteo Collina ***@***.***> wrote:
I think there is a huge performance cliff somewhere. Consider these two:
largeBuffers small search x 6,679 ops/sec ±1.11% (92 runs sampled)
largeBuffers medium search x 93.14 ops/sec ±0.80% (75 runs sampled)
This is a 60x drop. I think it's overall better than the previous one.
Do you plan to work more on this or we can land?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#61 (comment)>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AABlbmjPO-NAgxGcqsDUlovGI-zHN2oiks5uiRCMgaJpZM4XK9jQ>
.
|
ok one more patch, before
after
|
This uses a windowing approach to determine how much of a buffer can be searched by the native indexOf when searching. It falls back to JS when it hits a boundary and if there is no available native search window. I'm pretty sure a BufferList can't be searched drastically faster than this.