-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Speed up BytesRefHash#sort #12775
Speed up BytesRefHash#sort #12775
Conversation
Update:
New benchmark result:
|
For realistic data I tried to index |
Wow. Nice improvement! |
This is incredible speedup :) |
Something odd: I accidentally run the benchmark on another mac with
But I can easily reproduce the speedup on the
|
I checked linux x86, no obvious speedup too. Maybe the stable style somewhat helped the arm CPU cache
|
Maybe Apple chips are tuned for sorting (they need to sort out what to do with all these income bills, after all)? :) And seriously - thank you for checking on different hardware. There may be no single solution to fit them all - as the PR with vectorization benchmarks clearly shows... |
FWIW I think it's fine if this yields a speedup on some platforms but not other platforms. From your results, it doesn't seem to slow down flushing either? |
+1
Yes! Nothing got slow down. |
I came up with #12784 as another idea to speed up |
Close this in favor of #12784 |
Description
I noticed that we were seeing
StableRadixSorter
faster thanRadixSorter
in #91. And theStableRadixSorter
becomes even faster after we use aMergeSorter
instead ofInPlaceMergeSorter
in #12652. This PR proposes to use aStableRadixSorter
instead of theRadixSorter
forBytesRefHash
, in favor of the fact thatBytesRefHash
always guarantees the 2x space for theids
.In my benchmark that indexing 16 bytes UUIDS, the took of sort ~5,000,000 terms decreased ~35%.