rorygraves / scalac_perf

The Scala programming language
http://www.scala-lang.org/
16 stars 3 forks source link

Added statistics for time spent in symbol locks. #83

Closed odisseus closed 5 years ago

pkukielka commented 5 years ago

Please provide an example results. I do not see in the code how/where that times stats are printed out.

odisseus commented 5 years ago
./run.py -s ~/devel/scalac_perf/build/pack/ -- -Ystatistics

time spent in symbol locks    : 0 spans, ()0.0ms
time spent in Symbol.info     : 8360985 spans, ()11269.432ms aggregate, 7900.875ms specific
time spent in SymbolTable.infoTransformers: 283499 spans, ()11.883ms aggregate, 11.883ms specific

Compilation done in: 61.1133460999 s
odisseus commented 5 years ago

Reformatted

odisseus commented 5 years ago

There should be no problems with nested calls, because timer stacks are used. See scala/reflect/internal/util/Statistics.scala:256. I'm not absolutely sure I've used them correctly though.

odisseus commented 5 years ago

Apparently the timers add a lot of overhead themselves. I have measured the same compilation with JFR, and Symbol.info calls seem to take only about 1% of all time, although this still qualifies it into the top 5 hot methods.