java-tutorials/core-java-modules/core-java-concurrency-advan...
karl82 0b73db930f Update ThreadLocalRandom benchmark to show issues with contention (#8292)
Previous benchmark was measuring initialization of thread pools and
their shutdown, not really measuring performance of Random.nextInt()
shared Random instance vs ThreadLocalRandom.current()

Example when run with 8 threads

Benchmark                                                         Mode  Cnt     Score     Error   Units
ThreadLocalRandomBenchMarker.randomValuesUsingRandom             thrpt   20     9.597 ±   0.475  ops/us
ThreadLocalRandomBenchMarker.randomValuesUsingThreadLocalRandom  thrpt   20  2195.178 ± 109.579  ops/us
2020-01-30 11:10:20 -08:00
..
src Update ThreadLocalRandom benchmark to show issues with contention (#8292) 2020-01-30 11:10:20 -08:00
README.md [BAEL-17476] - Final edits for Add README descriptions 2019-12-15 09:50:35 +00:00
pom.xml [BAEL-18783] - Fix formatting of POMs 2019-12-06 11:40:56 +02:00