Integrated: 8318709: Improve System.nanoTime performance on Windows

Daniel Jeliński djelinski at openjdk.org
Mon Oct 30 07:57:42 UTC 2023


On Tue, 24 Oct 2023 08:23:01 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

> - use LARGE_INTEGER.QuadPart instead of assembling the jlong from high/low parts
> - precalculate counts_per_nano to avoid costly floating-point division in counter to nanosecond conversion
> 
> Benchmark before:
> SystemTime.nanoTime                avgt   15  19,366 � 0,383  ns/op
> 
> After:
> SystemTime.nanoTime                avgt   15  15,812 � 0,385  ns/op
> 
> Tier1-2 clean.

This pull request has now been integrated.

Changeset: 3934127b
Author:    Daniel Jeliński <djelinski at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/3934127b087ade1c1286008df3497ca6d84778a5
Stats:     16 lines in 1 file changed: 1 ins; 9 del; 6 mod

8318709: Improve System.nanoTime performance on Windows

Reviewed-by: ccleary, dholmes

-------------

PR: https://git.openjdk.org/jdk/pull/16336


More information about the hotspot-runtime-dev mailing list