-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
b29
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085694 | emb-9 | Attila Szegedi | P4 | Resolved | Fixed | team |
JDK-8064200 | 8u45 | Attila Szegedi | P4 | Resolved | Fixed | b01 |
JDK-8056160 | 8u40 | Attila Szegedi | P4 | Resolved | Fixed | b04 |
JDK-8070437 | emb-8u47 | Attila Szegedi | P4 | Resolved | Fixed | team |
If you look into CompilationPhase internal profiling, you will notice it uses System.currentTimeMillis for internal profiling, which limits the resolution to 1ms. If the compilation phase is faster than 1ms, then runtime.Timing will "aggregate" zero result into its accumulated statistics. Please change the uses to System.nanoTime.
Additionally, it might be worthwhile to consider other places as well:
$ ack-grep currentTimeMillis
src/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java
198: final long now = System.currentTimeMillis();
src/jdk/nashorn/internal/codegen/CompilationPhase.java
633: startTime = System.currentTimeMillis();
646: endTime = System.currentTimeMillis();
src/jdk/nashorn/internal/objects/NativeDate.java
134: this(System.currentTimeMillis());
257: return System.currentTimeMillis();
src/jdk/nashorn/internal/parser/Parser.java
258: final long t0 = isTimingEnabled ? System.currentTimeMillis() : 0L;
279: env._timing.accumulateTime(toString(), System.currentTimeMillis() - t0);
280: log.info(end, "' in ", System.currentTimeMillis() - t0, " ms");
src/jdk/nashorn/internal/runtime/Timing.java
60: this.startTime = System.currentTimeMillis();
169: final long t = System.currentTimeMillis();
Additionally, it might be worthwhile to consider other places as well:
$ ack-grep currentTimeMillis
src/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java
198: final long now = System.currentTimeMillis();
src/jdk/nashorn/internal/codegen/CompilationPhase.java
633: startTime = System.currentTimeMillis();
646: endTime = System.currentTimeMillis();
src/jdk/nashorn/internal/objects/NativeDate.java
134: this(System.currentTimeMillis());
257: return System.currentTimeMillis();
src/jdk/nashorn/internal/parser/Parser.java
258: final long t0 = isTimingEnabled ? System.currentTimeMillis() : 0L;
279: env._timing.accumulateTime(toString(), System.currentTimeMillis() - t0);
280: log.info(end, "' in ", System.currentTimeMillis() - t0, " ms");
src/jdk/nashorn/internal/runtime/Timing.java
60: this.startTime = System.currentTimeMillis();
169: final long t = System.currentTimeMillis();
- backported by
-
JDK-8056160 jdk.nashorn.internal.{codegen.CompilationPhase|runtime.Timing} should use System.nanoTime
- Resolved
-
JDK-8064200 jdk.nashorn.internal.{codegen.CompilationPhase|runtime.Timing} should use System.nanoTime
- Resolved
-
JDK-8070437 jdk.nashorn.internal.{codegen.CompilationPhase|runtime.Timing} should use System.nanoTime
- Resolved
-
JDK-8085694 jdk.nashorn.internal.{codegen.CompilationPhase|runtime.Timing} should use System.nanoTime
- Resolved
- relates to
-
JDK-8053904 JVM Warmup: Investigate class installation overhead
- Closed