> With the recent approval of UUIDv7 > (https://datatracker.ietf.org/doc/rfc9562/), this PR aims to add a new static > method UUID.timestampUUID() which constructs and returns a UUID in support of > the new time generated UUID version. > > The specification requires embedding the current timestamp in milliseconds > into the first bits 0–47. The version number in bits 48–51, bits 52–63 are > available for sub-millisecond precision or for pseudorandom data. The variant > is set in bits 64–65. The remaining bits 66–127 are free to use for more > pseudorandom data or to employ a counter based approach for increased time > percision (https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-7). > > The choice of implementation comes down to balancing the sensitivity level of > being able to distingush UUIDs created below <1ms apart with performance. A > test simulating a high-concurrency environment with 4 threads generating > 10000 UUIDv7 values in parallel to measure the collision rate of each > implementation (the amount of times the time based portion of the UUID was > not unique and entries could not distinguished by time) yeilded the following > results for each implemtation: > > > - random-byte-only - 99.8% > - higher-precision - 3.5% > - counter-based - 0% > > > Performance tests show a decrease in performance as expected with the counter > based implementation due to the introduction of synchronization: > > - random-byte-only 143.487 ± 10.932 ns/op > - higher-precision 149.651 ± 8.438 ns/op > - counter-based 245.036 ± 2.943 ns/op > > The best balance here might be to employ a higher-precision implementation as > the large increase in time sensitivity comes at a very slight performance > cost.
Kieran Farrell has updated the pull request incrementally with 117 additional commits since the last revision: - url with spec tag - 8360867: CTW: Disable inline cache verification Reviewed-by: kvn, thartmann - 8274051: Remove supports_vtime()/elapsedVTime() Reviewed-by: kbarrett, iwalulya - 8361032: Problem list TestOnSpinWaitAArch64 until JDK-8360936 is fixed Reviewed-by: alanb - 8330940: Impossible to create a socket backlog greater than 200 on Windows 8+ Reviewed-by: michaelm, dfuchs, alanb - 8359266: Delete the usage of AppContext in the GraphicsDevice Reviewed-by: aivanov, azvegint - 8360478: libjsig related tier3 jtreg tests fail when asan is configured Reviewed-by: dholmes, ihse - 8359596: Behavior change when both -Xlint:options and -Xlint:-options flags are given Reviewed-by: mcimadamore, uschindler - 8360312: Serviceability Agent tests fail with JFR enabled due to unknown thread type JfrRecorderThread Reviewed-by: sspitsyn, kevinw, dholmes - 8359761: JDK 25 RDP1 L10n resource files update Reviewed-by: aivanov, almatvee, nbenalla, jlu, dnguyen, cstein, naoto - ... and 107 more: https://git.openjdk.org/jdk/compare/adb50724...1011035f ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25303/files - new: https://git.openjdk.org/jdk/pull/25303/files/adb50724..1011035f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25303&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25303&range=07-08 Stats: 14624 lines in 651 files changed: 6244 ins; 5186 del; 3194 mod Patch: https://git.openjdk.org/jdk/pull/25303.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25303/head:pull/25303 PR: https://git.openjdk.org/jdk/pull/25303