Skip to content

Speeding up the incremental extraction of web jars #200

@adpi2

Description

@adpi2

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:

Would it be possible to use some sort of caching to speed up this step?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions