This repository was archived by the owner on Dec 29, 2022. It is now read-only.
Open
Conversation
Doing groupby string column (domains in reverse order) is one of our worse performingqueries we have. Mostly because we're grouping by 10s and 100s thousands of unique values. I've been trying to make this perform better for a long time. We got a nice but small speedup (5%) before by using CityHash64. After spending more time with perf, it looked like of the if condition branches was always taking a lot of time. For some reason it kept getting miss predicted. It was a simple boolean condition. On very large groupby (100,000 elements) this improves execution time by 5% to 10%. No observable regression to small inputs once the hash size check was introduced.
Author
|
It wouldn't hurt to use CityHash64 too. It's faster then the included Murmurhash64 about a net %5 shaved of our large group by queries with no other regressions. Works well for both large and small strings. Also tried FarmHash but it performed noticeably worse for short strings (like domains) then CityHash. |
Author
|
Actually, I'm seeing the small integer group by case (~ 250 values) get faster on a large number of runs by like 1.2%. |
Author
There was a problem hiding this comment.
Despite all the other work (CityHash), LRU buckets, moving the HASH_COMP_ONLY branch out (template arg). The end of the linked list check is the largest time sink. Not sure what we can do about this branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Doing groupby string column (domains in reverse order) is one of our worse
performingqueries we have. Mostly because we're grouping by 10s and 100s
thousands of unique values. I've been trying to make this perform better for
a long time. We got a nice but small speedup (5%) before by using CityHash64.
After spending more time with perf, it looked like of the if condition branches
was always taking a lot of time. For some reason it kept getting miss
predicted. It was a simple boolean condition.
On very large groupby (100,000 elements) this improves execution time by 5% to
10%. No observable regression to small inputs once the hash size check was
introduced.