Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speeding up the incremental extraction of web jars #200

Open
adpi2 opened this issue May 19, 2023 · 3 comments
Open

Speeding up the incremental extraction of web jars #200

adpi2 opened this issue May 19, 2023 · 3 comments

Comments

@adpi2
Copy link
Member

adpi2 commented May 19, 2023

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?

@mkurz
Copy link
Member

mkurz commented May 19, 2023

Did you test with 1.5.0-M1? I just released that 3 days ago: https://github.com/sbt/sbt-web/releases/tag/1.5.0-M1

@adpi2
Copy link
Member Author

adpi2 commented May 19, 2023

It is significantly faster:

[info]   server / Compile / copyResources                                  : 481 ms
[info]   server / Web-assets / webJars                                     : 419 ms
[info]   server / Web-assets / assets                                      : 361 ms
[info]   server / Web-assets-test / webJars                                : 359 ms

But still, would it be possible to not touch the managed resources, so that sbt doesn't need to copy them?

@mkurz
Copy link
Member

mkurz commented May 19, 2023

@adpi2 Maybe. If you provide a pull request, I am happy to review it. I don't currently have time to take a closer look here myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants