RFR: 8273239: Standardize Ticks APIs return type [v2]
Albert Mingkun Yang
ayang at openjdk.java.net
Wed Sep 8 21:14:05 UTC 2021
On Wed, 8 Sep 2021 16:54:44 GMT, Paul Hohensee <phh at openjdk.org> wrote:
> First, why is ElapsedCounter::frequency() ignored in this patch?
Its value is a constant and unlikely to change in the future, so I went for easier-to-read code over the more extensible approach. If you think not hard-coding such knowledge in `ticks` is more beneficial, I can revise it as suggested.
> Second, why are/were we potentially losing precision by converting everything to double internally and then converting the result to the target type?
In order to avoid truncating the types in the middle of the calculation. It's possible that the final result fits in `T`, but some intermediate values cause overflow for `T`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5332
More information about the hotspot-dev
mailing list