Skip to content

Move Bsp to a separate worker#6853

Open
re-thc wants to merge 4 commits intocom-lihaoyi:mainfrom
re-thc:comp
Open

Move Bsp to a separate worker#6853
re-thc wants to merge 4 commits intocom-lihaoyi:mainfrom
re-thc:comp

Conversation

@re-thc
Copy link
Contributor

@re-thc re-thc commented Feb 19, 2026

Was looking into cold start performance and Bsp downloads a lot of libs before anything happens (and likely isn't used in a lot of paths).

This moves it to a worker.

@lihaoyi
Copy link
Member

lihaoyi commented Feb 19, 2026

Can you report what the difference in the number of libs downloaded is with and without this PR, and their total size in mb/gb?

@re-thc
Copy link
Contributor Author

re-thc commented Feb 19, 2026

@lihaoyi

On main: 73.79MB
On this PR: 66.02MB

So saved 7.4MB (that's about 10%)

Big changes: jgit, guava, gson, bsp4j, lsp4j

It's not just download size and download time. Coursier also has to hash and analyze them.

@lefou
Copy link
Member

lefou commented Feb 19, 2026

@lihaoyi

On main: 73.79MB On this PR: 66.02MB

So saved 7.4MB (that's about 10%)

Big changes: jgit, guava, gson, bsp4j, lsp4j

It's not just download size and download time. Coursier also has to hash and analyze them.

If not for the size, I find i good thing to not have these deps on the default classpath.

@lihaoyi
Copy link
Member

lihaoyi commented Feb 19, 2026

@lefou this stuff is on the daemon classpath, not on the build.mill classpath, so apart from the download size this change wouldn't affect users at all

Copy link
Member

@lefou lefou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't have a deep look at the implementation changes and probably wont in a timely manner. Just two small comments below.

Comment on lines 531 to 525
): (BspServerHandle, BuildClient) = {
): (BspServerHandle, AnyRef) = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we introduce some type here? AnyRef screams for trouble and doesn't help at all when reading the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

import mill.client.lock.Lock
import mill.util.{BuildInfo, Jvm}

private object BspIdeaWorkerSupport {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe replace the BspIdea with Ide.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@re-thc
Copy link
Contributor Author

re-thc commented Feb 19, 2026

Context is I'm trying to migrate from Gradle. On cold start it's easily 8x slower on a build. Pretty significant. This triggers on CI or other use cases. Did some profiling and trying to reduce it. So the download size is a thing.

A separate topic, but the caching and remote caching has come up in other topics and so far it doesn't really resolve it so I'm trying to tackle cold starts 1st.

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

Successfully merging this pull request may close these issues.

3 participants

Comments