RFR: 8308804: Improve UUID.randomUUID performance with bulk/scalable PRNG access [v7]
Aleksey Shipilev
shade at openjdk.org
Thu Jun 1 13:05:12 UTC 2023
On Thu, 1 Jun 2023 12:59:14 GMT, Brett Okken <duke at openjdk.org> wrote:
>> Aleksey Shipilev has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits:
>>
>> - Revert test changes
>> - Merge branch 'master' into JDK-8308804-uuid-buffers
>> - Simplify clinit
>> - Remove the properties
>> - Swap lsb/msb
>> - Fine-tune exceptions
>> - Handle privileged properties
>> - Use ByteArray to convert. Do version/variant preparations straight on locals. Move init out of optimistic lock section.
>> - More touchups
>> - Comment updates
>> - ... and 3 more: https://git.openjdk.org/jdk/compare/4460429d...fd7eaa1a
>
> src/java.base/share/classes/java/util/UUID.java line 234:
>
>> 232: long msb = ByteArray.getLong(buf, 0);
>> 233: long lsb = ByteArray.getLong(buf, 8);
>> 234: return fromRandom(msb, lsb);
>
> is there any value in moving this outside of the critical section?
I have tried it before, and it gives no benefit, but significantly complicates the code. This is the part under write lock, where we have spent a significant time refilling the buffer. The little improvement we might get here is drowning in those costs.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14135#discussion_r1213121408
More information about the core-libs-dev
mailing list