and i compiled on a system with 6 cores / 12 threads. They are running all above 90% load most of the time. There are no macro’s (all removed after the transition from Scala 2 to Scala 3).
I also tried to compile my opensource Leucine project but that fails with:
Just my 2 cents.
I have a small project GitHub - sacode387/FlowRun: Executable flow diagrams
Tested with sbt "clean; compile", got from ~22s to ~20s.
Tested with sbt and then clean; compile, got from 9s to 6s.
So seems like in interactive mode it’s around 30% improved.
I would recommend cycling through clean -> compile a few times to get rid of effects such as checking for dependency updates, and give a chance for JIT compilation to make compiler performance be more deterministic.
I checked out the project sake92/hepek as you mentioned and from a cold boot for both pipelining and not, ran clean;hepek/compile over and over in the shell. After enough cycles pipelining was consistently 4-5 seconds, and not pipelining 6-7 seconds.
but I have the slides uploaded also. I actually profiled the timestamps of when each part of the scala 3 build began, so I can present a timeline of compilation tasks:
Slide with comparison of pipelining with vanilla Scala:
Slide with comparison of outline compilation and worker threads with vanilla Scala:
its important to note that the diagrams are made from real timestamps recorded by a profiler, so we can see that sbt schedules projects to begin earlier. Because in the Scala 3 build the majority of time is spent in the final project, it does not benefit much from pipelining, but when activating the outline typing mode and parallel worker threads (still WIP) we get 33% speedup. There are other configurations we could experiment with as well.
Hi, I’ve given this a try in our work project consisting of 7 modules (JVM + JS). After publishing the zerowaste plugin locally against this Scala version, I’ve got the following results.
Scala 3.5.0-RC1-NIGHTLY: Pipelining OFF (failed compilation)
$ time sbt "clean; compile"
Executed in 118.12 secs fish external
usr time 15.26 mins 0.00 micros 15.26 mins
sys time 0.59 mins 838.00 micros 0.59 mins
Scala 3.5.0-RC1-NIGHTLY: Pipelining ON (failed compilation)
$ time sbt "clean; compile"
Executed in 133.21 secs fish external
usr time 17.71 mins 0.00 micros 17.71 mins
sys time 0.65 mins 811.00 micros 0.65 mins
Scala 3.5.0-RC1-NIGHTLY: Pipelining OFF (successful compilation)
$ time sbt "clean; compile"
Executed in 134.35 secs fish external
usr time 16.25 mins 0.00 millis 16.25 mins
sys time 0.63 mins 1.61 millis 0.63 mins
Scala 3.5.0-RC1-NIGHTLY: Pipelining ON (successful compilation)
$ time sbt "clean; compile"
Executed in 124.09 secs fish external
usr time 16.91 mins 0.00 micros 16.91 mins
sys time 0.63 mins 801.00 micros 0.63 mins
Scala 3.3.3
For reference, here are the results with the Scala version we actually use.
$ time sbt "clean; compile"
Executed in 75.74 secs fish external
usr time 681.12 secs 0.07 millis 681.12 secs
sys time 23.15 secs 1.01 millis 23.15 secs
I have included the results of the compilation that resulted in failure with the NIGHTLY version due to -Xfatal-warnings, but it did seem to compile the different modules in parallel.
The compilation time was slightly reduced with pipelining enabled during the successful compilations (disabling -Xfatal-warnings), but it’s considerably slower comparing it with Scala 3.3.3.
Happy to share any more relevant configuration details that could help, except the source code for obvious reasons
@gvolpe Did you try to run clean/compile several times to account for any JIT compilation?, That difference between 3.3.3 and 3.5-snapshot is quite alarming - it would be really good to report anything you find to scala/scala3 on GitHub - we do have a few in-flight issues about performance problems so maybe you hit the same one
That’s a good call, I didn’t before, so I tried again. Pipelined compilation is still as slow, but not so much difference between Scala 3.3.3 and 3.5-nightly.
In the following results, the first line always corresponds to the first execution with those settings (usually slower), the second line to the second execution and so on.
Scala 3.3.3
Executed in 137.65 secs fish external
usr time 17.65 mins 0.00 micros 17.65 mins
sys time 0.51 mins 784.00 micros 0.51 mins
Executed in 69.84 secs fish external
usr time 674.95 secs 0.00 millis 674.95 secs
sys time 24.09 secs 1.72 millis 24.09 secs
Executed in 73.79 secs fish external
usr time 667.21 secs 0.00 micros 667.21 secs
sys time 23.39 secs 955.00 micros 23.39 secs
Executed in 72.61 secs fish external
usr time 684.94 secs 526.00 micros 684.94 secs
sys time 24.10 secs 363.00 micros 24.10 secs
Scala 3.5-nightly - Pipelining OFF
Executed in 139.74 secs fish external
usr time 16.80 mins 0.15 millis 16.80 mins
sys time 0.64 mins 1.04 millis 0.64 mins
Executed in 78.43 secs fish external
usr time 696.23 secs 0.00 millis 696.23 secs
sys time 28.91 secs 1.06 millis 28.91 secs
Executed in 76.89 secs fish external
usr time 688.25 secs 713.00 micros 688.25 secs
sys time 29.01 secs 269.00 micros 29.01 secs
Executed in 77.26 secs fish external
usr time 700.63 secs 704.00 micros 700.62 secs
sys time 29.45 secs 268.00 micros 29.45 secs
Scala 3.5-nightly - Pipelining ON
Executed in 142.46 secs fish external
usr time 18.51 mins 0.00 micros 18.51 mins
sys time 0.68 mins 840.00 micros 0.68 mins
Executed in 133.74 secs fish external
usr time 16.46 mins 0.00 millis 16.46 mins
sys time 0.62 mins 1.14 millis 0.62 mins
Executed in 135.49 secs fish external
usr time 17.18 mins 0.00 millis 17.18 mins
sys time 0.66 mins 1.13 millis 0.66 mins
Executed in 138.20 secs fish external
usr time 16.60 mins 0.00 micros 16.60 mins
sys time 0.63 mins 831.00 micros 0.63 mins
@gvolpe I have to say I can’t really offer any diagnostics without suggesting you perhaps use a profiler, such as -Yprofile-enabled combined with -Yprofile-destination foo-project.csv (I recommend a destination file derived from the project name)
if you were to record that data, it can give an insight into any differences in how long compiler phases are taking, and when projects are scheduled.
I use this script to parse the output of each project into a single csv I can copy into google sheets and generate a Gantt chart:
Other options include comparing async-profiler flame charts side-by side
I tried the 3.4.2 version and got some puzzling bugs with cyclic imports. And then I tried the 3.5.0-RC1 version, no bugs at all! The speed-up on GitHub - etorreborre/specs2: Software Specifications for Scala is not huge, like 10 to 15%, but what I realize is crazy is how fast the Scala compiler has become. A full recompile of the project in a hot sbt session takes now 15 or 16 seconds (with pipelining). This is a serious achievement so kudos to everyone involved!!!