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
chore(core): FastMap to use Robin Hood hashing #4054
Conversation
|
@@ -333,22 +333,63 @@ private FastMapValue asNew(BaseKey keyWriter, int index, int hashCode, FastMapVa | |||
kPos = (kPos + 7) & ~0x7; | |||
setOffset(offsets, index, keyWriter.startAddress - heapStart); | |||
setHashCode(offsets, index, hashCode); | |||
if (--free == 0) { |
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.
Shouldn't we change the default load factor for FastMap
to 0.8 or even 0.9? To me, the main benefit of using Robin Hood hashing is being able to fit more entries into less memory and that should improve performance in certain scenarios.
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.
good idea, I can test it.
[PR Coverage check]😍 pass : 50 / 50 (100.00%) file detail
|
closing as new results do not show any improvements with default load and actually it performs worse with higher loads. chances are this PR shifted bottlenecks: #4032 |
FastMap to use Robin Hood hashing.
Testing setup: Clickbench running on c6a.16xlarge
Query:
SELECT UserID, COUNT(*) AS c FROM hits GROUP BY UserID ORDER BY c DESC LIMIT 10;
7.3.8-snapshot vanilla
timings: 10992530610
timings: 10956769125
timings: 10934153712
timings: 10952430208
timings: 10920044785
timings: 10868601623
timings: 10865651603
timings: 10885177297
7.3.8-snapshot + Robin Hood FastMap
timings: 10353366441
timings: 10266570821
timings: 10262674985
timings: 10261647727
timings: 10245524141
timings: 10273126124
timings: 10252424759
timings: 10245550197