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.
Summary:
The distribution metric is faster when it's not contended,
but degrades during heavy contention.
Analysis:
Histogram throughput scales almost linearly with number of cores,
and maxes out at 52 ops/us, both with 4 and 8 threads.
Contention does not appear to be an issue there.
Distribution throughput is best when running with a single thread,
maxing out at 47 ops/us and drops down to 13 ops/us when running
with 4 threads. Going to 8 threads actually increases the throughput
though.
With a single thread, histogram runs in 0.055 us/op on average
and distribution runs in 0.021 us/op which is more than twice as fast.
However, when running with 4 threads concurrently, the distribution
average speed is 0.325 us/op (15x slower) compared to histogram which runs at
0.073 us/op (1.3x slower).
REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on
why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial
experiments, perform baseline and negative tests that provide experimental control, make sure
the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts.
Do not assume the numbers tell you what you want them to tell.