Skip to content
This repository was archived by the owner on Jul 7, 2020. It is now read-only.

HyperLogLog made thread-safe using atomic operations#17

Closed
assaron wants to merge 2 commits into
addthis:masterfrom
assaron:master
Closed

HyperLogLog made thread-safe using atomic operations#17
assaron wants to merge 2 commits into
addthis:masterfrom
assaron:master

Conversation

@assaron
Copy link
Copy Markdown

@assaron assaron commented Feb 15, 2013

HyperLogLog and underlying RegisterSet use atomic operations, so HyperLogLog.offer() can be called from different threads.

RegisterSet use AtomicIntegerArray and CASs for setting values.
@tea-dragon
Copy link
Copy Markdown
Contributor

I can't see much of a reason for a substantial increase in memory use but that might be a good thing to test also. You might be interested in the library http://code.google.com/p/caliper/ which has some helpful functions and guidence on robust benchmarking. I would also be curious to see how well it scales with multiple threads but I suppose performance might not be the only motivation for thread safety.

@tdunning
Copy link
Copy Markdown
Contributor

Wouldn't it be better to simply keep a separate HyperLogLog accumulator per
thread? Memory increase would give far better performance than using
atomic objects.

On Fri, Feb 15, 2013 at 10:14 AM, Ian Barfield notifications@github.comwrote:

I can't see much of a reason for a substantial increase in memory use but
that might be a good thing to test also. You might be interested in the
library http://code.google.com/p/caliper/ which has some helpful
functions and guidence on robust benchmarking. I would also be curious to
see how well it scales with multiple threads but I suppose performance
might not be the only motivation for thread safety.


Reply to this email directly or view it on GitHubhttps://github.com//pull/17#issuecomment-13617058.

@assaron
Copy link
Copy Markdown
Author

assaron commented Feb 18, 2013

Ted, it's seems reasonable. I'll try that.

@abramsm abramsm closed this Feb 18, 2013
@abramsm abramsm mentioned this pull request Jul 2, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants