mirror of https://github.com/sbt/sbt.git
The sbt project load made a number of relatively inefficient transformations of scala collecitons. I went through and found the slow parts during project loading and made my best attempt at fixing them. The most significant changes I made were in places using IMap. An IMap is more or less a wrapper around an immutable Map. It can be much faster to construct an IMap by creating a java mutable hashmap, wrapping it a scala Map that delegates to the underlying java hashmap (with a copy on write if the map is modified) and constructing the IMap from the wrapped map. It was also in many cases to parallelize some transformations wherever the order didn't matter. After applying all of these changes, I found that loading the sbt project took generally between 8.5 and 9 seconds on my laptop. With 1.3.13, it hovered around 11.5 seconds. I saw a similar speedup in zinc. The biggest specific improvement was that generating the compiled map dropped from between 3.5-4 seconds to pretty consistently being around 1.5 seconds. |
||
|---|---|---|
| .. | ||
| src | ||
| NOTICE | ||