random: Random vs ThreadLocalRandom vs SecureRandom vs RandomGenerator module (seeds and a 2-output predictor, ranges and measured modulo bias, ThreadLocalRandom limits, SecureRandom algorithms and setSeed behaviour, the 13 java.util.random algorithms with split/jump, indicative timings), 16 contract tests
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6F5pq1M5ni1bNw8gr
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
cores available: 2
|
||||
|
||||
== One thread: nanoseconds per nextInt(), 20000000 calls ==
|
||||
Random 8.5 ns/op
|
||||
SplittableRandom 0.7 ns/op
|
||||
ThreadLocalRandom 2.1 ns/op
|
||||
L32X64MixRandom (default) 2.9 ns/op
|
||||
Xoshiro256PlusPlus 2.7 ns/op
|
||||
SecureRandom 90.6 ns/op
|
||||
|
||||
== 4 threads sharing ONE instance, 5000000 calls each (wall time, ms) ==
|
||||
Random (shared) 987 ms
|
||||
SecureRandom (shared) 7329 ms
|
||||
ThreadLocalRandom.current() 37 ms
|
||||
checksum (ignore): -28432667108051
|
||||
Reference in New Issue
Block a user