Scala compilation time

In Scala, I need to profile the compilation time of several different versions of the same file that the same result will be produced at startup.

Example:

time scalac foo1.scala 
  • 0m6.002s

 time scalac foo2.scala 
  • 0m5.784s

 time scalac foo3.scala 
  • 0m6.212s

This project seems to be doing just that, but I have never done anything like this before, and the instructions do not seem very friendly for beginners. If I cannot do this, I will probably take advantage of this , but I think in macro compilation The benchmark measures only the time spent on parse and typecheck, and not the compilation time of the entire file.

Ideally, I would like to know how long it takes from the first compilation phase (parser) to the last phase (generate JVM bytecode), it is not necessary to enable jvm "warm-up" time.

+5
source share

All Articles