Glavo
Glavo
Here are the results for the `RandomGeneratorNextBytes` benchmark (Here will be continuously updated to show the latest results): ``` (Baseline) (This PR) Benchmark (algo) (length) Mode Cnt Score Error Units...
The only confirmed performance degradation (
> Also, should we use ByteArrayLittleEndian instead of Unsafe, once ByteArrayLittleEndian is no longer dependent on VarHandle? Due to the overhead of using non aligned reads and checking indexes, `ByteArrayLittleEndian`...
> Due to the overhead of using non aligned reads and checking indexes, `ByteArrayLittleEndian` is slower than directly calling `getLong`. Well, it seems that this is not always correct. For...
Benchmarking results based on current `ByteArrayLittleEndian`(VarHandle): Results ``` Benchmark (length) Mode Cnt Score Error Units RandomBenchmark.L32X64MixRandom 0 thrpt 5 1519005.337 ± 10166.724 ops/ms RandomBenchmark.L32X64MixRandom 1 thrpt 5 215438.181 ± 1296.270...
> I searched through usages of the nexBytes method on GitHub and mostly found a) usages of SecureRandom#nextBytes, which aren't affected by this, and b) usages with small arrays, where...
> Auto-vectorization might be already at work for RandomGenerator. We need to prove the optimization offered by Unsafe putLong and VarHandle are reliable instead of some unreliable side effects of...
Use `Unsafe::putIntUnaligned`/`Unsafe::putLongUnaligned`: Results ``` Benchmark (length) Mode Cnt Score Error Units RandomBenchmark.L32X64MixRandom 0 thrpt 5 1524860.609 ± 25736.732 ops/ms RandomBenchmark.L32X64MixRandom 1 thrpt 5 215406.292 ± 2337.313 ops/ms RandomBenchmark.L32X64MixRandom 2 thrpt...
The new implementation of `ByteArrayLittleEndian` in #14636 performs consistently with the old implementation using `VarHandle`. (This conclusion gives me more confidence in #14636) Interestingly, `Unsafe::putIntUnaligned`/`Unsafe::putLongUnaligned` is not always faster than...
> Can you publish your put_Unaligned code and the one with updated ByteArrayLittleEndian in two branches in your fork? I doubt something might be off in your code, and wish...