[UNVERIFIED SENDER] RFR: 8273239: Standardize Ticks APIs return type
Kim Barrett
kim.barrett at oracle.com
Thu Sep 2 21:40:00 UTC 2021
[resending from the correct account, so it gets to the mailing list and the PR.]
> On Sep 2, 2021, at 3:04 PM, Hohensee, Paul <hohensee at amazon.com> wrote:
>
> I haven't been following this thread, so please forgive redundancy.
>
> For the fully concurrent collectors such as Shenandoah, ZGC, and C4, we want to be able to measure intervals that may be shorter than a millisecond. Azul uses seconds-as-doubles to do this in their MXBean APIs (see https://docs.azul.com/prime/MXBeans), but given that Hotspot has access to nanotime counters and that a long can hold ~272 years of nanoseconds, I'd very much like for Hotspot to standardize on nanoseconds internally and make millis and seconds available as convenience methods.
There’s been some effort in GC code to use the Ticks utility (which I think ends up being nanoseconds
on all supported platforms) internally, and convert to other types for logging and other API boundaries
that require other types. See, for example,
https://bugs.openjdk.java.net/browse/JDK-8208390
I thought that had already been done, but apparently not. Maybe there was just an unfinished prototype?
Quite possibly it got too big for one change set.
More information about the hotspot-dev
mailing list