-
Notifications
You must be signed in to change notification settings - Fork 4
add partitioning #3
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
base: master
Are you sure you want to change the base?
Conversation
instead of 1 big heap we now split he heap in n (n=6) heaps to and assign elements to to one of the heaps based on the hash. This way we reduce switching on heavyhitters and reduce merge errors
mschoch
left a comment
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.
So, I spotted a few mechanical things noted here. And my understanding is that you have replaced the single map/heap with N partitioned map/heaps, where the hash of the key (which you computed anyway) is used to choose the partition. I will wait for your explanation to review again with that in mind.
topk.go
Outdated
| var ( | ||
| err error | ||
| ) | ||
| for i := 0; i < 6; i++ { |
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.
Should this be nPartitions?
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.
yep
topk.go
Outdated
| if len(s.k.elts) < s.n { | ||
| // there is free space | ||
| if len(s.p[i].elts) < s.n { | ||
| // there is free sp[i]ace |
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.
Search/Replace error or some deep joke I don't get?
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.
a joke :P
| idx2, ok2 := other.p[i].m[k] | ||
| xhash := reduce(metro.Hash64Str(k, 0), len(s.alphas)) | ||
| min1 := other.alphas[xhash] | ||
| min2 := other.alphas[xhash] |
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.
min1 and min2 are always assigned the same value, and they appear to only be read inside this scope. Is there some reason we need both?
instead of 1 big heap we now split he heap in n (n=6) heaps to and assign elements to to one of the heaps based on the hash. This way we reduce switching on heavy hitters and reduce merge errors