Breaking change: using LongAdder instead of AtomicLong by dfa1 · Pull Request #186 · graphql-java/java-dataloader
This is intended as proposal for #140
dfa1
mentioned this pull request
Use `LongAdder` instead of `AtomicLong`, that is more suitable for high contention (see the javadoc).
| import java.util.concurrent.atomic.AtomicLong; | ||
| import java.util.concurrent.atomic.LongAdder; | ||
|
|
||
| public class AtomicVsAdder { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in future a JMH benchmark is way better - we have them in dataloader recently
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, if you don't mind, I would like to drop this class as LongAdder is well-known class in JDK built exactly for this use case
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets do it
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