Calculating JIT compilation time

18 views
Skip to first unread message

mehra.a...@gmail.com

unread,
Jan 16, 2018, 5:55:18 AM1/16/18
to JITWatch
Hi all,

Is there a way in OpenJDK+Hotspot to determine how much time is spent by JIT threads in compiling the methods?
Does JITWatch provide this information? I know it provides a histogram "JIT Compilation Times" but I actually need the cumulative time.

Any help is appreciated!

Thanks,
Ashutosh Mehra

Chris Newland

unread,
Jan 16, 2018, 8:20:06 AM1/16/18
to JITWatch
Hi Ashutosh,

HotSpot will tell you this directly if you add the flag

-XX:+CITime

Example output from running java -XX:+CITime without a class or jar name:


Accumulated compiler times (for compiled methods only)
------------------------------------------------
  Total compilation time   :  0.013 s
    Standard compilation   :  0.013 s, Average : 0.000
    On stack replacement   :  0.000 s, Average : -nan
    Detailed C1 Timings
       Setup time:         0.000 s ( 0.0%)
       Build IR:           0.003 s (39.0%)
         Optimize:            0.000 s ( 2.6%)
         RCE:                 0.000 s ( 0.8%)
       Emit LIR:           0.004 s (40.8%)
         LIR Gen:           0.001 s ( 8.3%)
         Linear Scan:       0.003 s (32.1%)
       LIR Schedule:       0.000 s ( 0.0%)
       Code Emission:      0.001 s (12.9%)
       Code Installation:  0.001 s ( 7.2%)
       Instruction Nodes:   2454 nodes

  Total compiled methods   :     51 methods
    Standard compilation   :     51 methods
    On stack replacement   :      0 methods
  Total compiled bytecodes :   3298 bytes
    Standard compilation   :   3298 bytes
    On stack replacement   :      0 bytes
  Average compilation speed: 260427 bytes/s

  nmethod code size        :  48096 bytes
  nmethod total size       :  77480 bytes

JITWatch does provide timing information in various places but doesn't give a nice detailed summary like this!

Cheers,

Chris

ashutosh mehra

unread,
Jan 16, 2018, 11:12:43 PM1/16/18
to Chris Newland, JITWatch
That's exactly I wanted. Thanks Chris!

--
You received this message because you are subscribed to a topic in the Google Groups "JITWatch" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jitwatch/NrT_fqoajrs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jitwatch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages