Rsc is an experimental Scala compiler focused on compilation speed. This project is developed by Eugene Burmako and his team at Twitter.
In this document, we aim to publish the results of running our benchmark suite on the most recent commit in our repository. Since running benchmarks takes time, there may be short periods of time when this document is out of date. If you're curious about the exact version of Rsc that is benchmarked in this document, click here.
All benchmarks run on a computer with Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz (4x32KB+32KB L1 cache, 4x256KB L2 cache, 8192KB L3 cache, configured to run 4 physical cores and 4 logical cores with Turbo Boost disabled), 31GB RAM and Crucial_CT240M50 disk drive.
In our benchmarks, we use Debian GNU/Linux 9.4 (stretch) and Java(TM) SE Runtime Environment (build 1.8.0_171-b11) to run Rsc 0.0.0-179-86ab8179 and Scalac 2.11.12. To benchmark JVM applications, we use sbt-jmh 0.2.27 that runs in sbt 0.13.17.
Our benchmarks run different fragments of compilation pipelines of different compilers on https://github.com/maxov/rsc/tree/86ab817950f1a6fd0ba13df2399cffabbdf31eb7/examples/core that contains 96 files totaling 20143 lines of code.
Every benchmark runs in in hot mode, i.e. it computes performance of a steady state of the JVM achieved by doing a number of warmup runs in JMH.
At this point, Rsc only implements a subset of functionality provided by the Scala compiler. This means that the benchmark results provided below must be interpreted with utmost care. Concretely:
- Performance numbers may significantly deteriorate as we will be implementing more and more functionality of the Scala compiler. For example, adding support for implicit search or type inference is very likely to slow down our compiler by a significant factor.
- Direct comparisons of Rsc and Scalac performance numbers should take into account similarities and differences in provided functionality. Consult the summary in the "Compiler" document for more information.
To reproduce, run bin/bench
(this will take a while).
Individual | Cumulative | |
RscParse | 19.775 ms | 19.775 ms |
RscLink | 52.85 ms | 72.625 ms |
RscOutline | 39.416 ms | 112.041 ms |
RscSemanticdb | 25.243 ms | 137.284 ms |
RscMjar | 287.346 ms | 424.630 ms |
ScalacCompile | 3723.703 ms | 3723.703 ms |
At the moment, generating SemanticDB signatures from an automatically rewritten core of Twitter Util is ~27x faster than full Scalac compilation. Generating ScalaSignatures is ~9x faster.