Skip to content
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

Update counters to LongAdder as appropriate #54

Open
myllynen opened this issue Mar 20, 2018 · 0 comments
Open

Update counters to LongAdder as appropriate #54

myllynen opened this issue Mar 20, 2018 · 0 comments

Comments

@myllynen
Copy link
Contributor

Parfait already requires Java 8 which introduced LongAdder. From https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/LongAdder.html:

This class is usually preferable to AtomicLong when multiple threads update a common sum that is used for purposes such as collecting statistics, not for fine-grained synchronization control. Under low update contention, the two classes have similar characteristics. But under high contention, expected throughput of this class is significantly higher, at the expense of higher space consumption.

Counters implemented with AtomicInteger should be migrated to LongAdded as appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant