Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Found something very useful. I am not sure if this is what I am looking for. I am yet to analyse the results. But this is quite interesting. We can gather some performance statistics using the HPROF profiler agent shipped with the JDK release. The good thing is that it can be run during the compilation to produce some interesting statistics on the code beign compiled. Following are some samples. More details can be found at <a href="http://download.oracle.com/javase/7/docs/webnotes/tsg/TSG-VM/html/tooldescr.html#gbluz" rel="nofollow">http://download.oracle.com/javase/7/docs/webnotes/tsg/TSG-VM/html/tooldescr.html#gbluz</a> </p> <pre><code>$ javac -J-agentlib:hprof=heap=sites Hello.java SITES BEGIN (ordered by live bytes) Wed Oct 4 13:13:42 2006 percent live alloc'ed stack class rank self accum bytes objs bytes objs trace name 1 44.13% 44.13% 1117360 13967 1117360 13967 301926 java.util.zip.ZipEntry 2 8.83% 52.95% 223472 13967 223472 13967 301927 com.sun.tools.javac.util.List 3 5.18% 58.13% 131088 1 131088 1 300996 byte[] 4 5.18% 63.31% 131088 1 131088 1 300995 com.sun.tools.javac.util.Name[] $ javac -J-agentlib:hprof=heap=dump Hello.java HEAP DUMP BEGIN (39793 objects, 2628264 bytes) Wed Oct 4 13:54:03 2006 ROOT 50000114 (kind=&lt;thread&gt;, id=200002, trace=300000) ROOT 50000006 (kind=&lt;JNI global ref&gt;, id=8, trace=300000) ROOT 50008c6f (kind=&lt;Java stack&gt;, thread=200000, frame=5) : CLS 50000006 (name=java.lang.annotation.Annotation, trace=300000) loader 90000001 OBJ 50000114 (sz=96, trace=300001, class=java.lang.Thread@50000106) name 50000116 group 50008c6c contextClassLoader 50008c53 inheritedAccessControlContext 50008c79 blockerLock 50000115 OBJ 50008c6c (sz=48, trace=300000, class=java.lang.ThreadGroup@50000068) name 50008c7d threads 50008c7c groups 50008c7b ARR 50008c6f (sz=16, trace=300000, nelems=1, elem type=java.lang.String[]@5000008e) [0] 500007a5 CLS 5000008e (name=java.lang.String[], trace=300000) super 50000012 loader 90000001 : HEAP DUMP END $ javac -J-agentlib:hprof=cpu=times Hello.java CPU TIME (ms) BEGIN (total = 2082665289) Wed oct 4 13:43:42 2006 rank self accum count trace method 1 3.70% 3.70% 1 311243 com.sun.tools.javac.Main.compile 2 3.64% 7.34% 1 311242 com.sun.tools.javac.main.Main.compile 3 3.64% 10.97% 1 311241 com.sun.tools.javac.main.Main.compile 4 3.11% 14.08% 1 311173 com.sun.tools.javac.main.JavaCompiler.compile 5 2.54% 16.62% 8 306183 com.sun.tools.javac.jvm.ClassReader.listAll 6 2.53% 19.15% 36 306182 com.sun.tools.javac.jvm.ClassReader.list 7 2.03% 21.18% 1 307195 com.sun.tools.javac.comp.Enter.main 8 2.03% 23.21% 1 307194 com.sun.tools.javac.comp.Enter.complete 9 1.68% 24.90% 1 306392 com.sun.tools.javac.comp.Enter.classEnter 10 1.68% 26.58% 1 306388 com.sun.tools.javac.comp.Enter.classEnter ... CPU TIME (ms) END </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload