The incremental compilation of my project (scalacenter/scaladex) is slowed down by the webJars task.
If I run server/Test/compile twice without changing any source, it takes about 3 sec each and the time is spent on extracting the web jars and coyping the resources. That's kind of slow for a no-op incremental compilation.
$ sbt -Dsbt.task.timings=true
sbt:scaladex> server / Test / compile
[info] Total time: 2481 ms
[info] server / Web-assets / webJars : 824 ms
[info] server / Web-assets-test / webJars : 678 ms
[info] server / Compile / copyResources : 444 ms
[info] server / Web-assets / assets : 297 ms
...
[success] Total time: 3 s, completed May 19, 2023, 2:31:57 PM
sbt:scaladex> server / Test / compile
[info] Total time: 2431 ms
[info] server / Web-assets / webJars : 787 ms
[info] server / Web-assets-test / webJars : 677 ms
[info] server / Compile / copyResources : 469 ms
[info] server / Web-assets / assets : 283 ms
...
[success] Total time: 3 s, completed May 19, 2023, 2:34:03 PM
After some investigation I found out that most of the time is spent in:
|
e.extractAllWebJarsTo(to) |
Would it be possible to use some sort of caching to speed up this step?
The incremental compilation of my project (scalacenter/scaladex) is slowed down by the
webJarstask.If I run
server/Test/compiletwice without changing any source, it takes about 3 sec each and the time is spent on extracting the web jars and coyping the resources. That's kind of slow for a no-op incremental compilation.After some investigation I found out that most of the time is spent in:
sbt-web/src/main/scala/com/typesafe/sbt/web/SbtWeb.scala
Line 450 in ba7674e
Would it be possible to use some sort of caching to speed up this step?