Skip to content

Optimize the standard library in bootstrapped compilation#25689

Open
SolalPirelli wants to merge 1 commit intoscala:mainfrom
dotty-staging:solal/optimize-stdlib
Open

Optimize the standard library in bootstrapped compilation#25689
SolalPirelli wants to merge 1 commit intoscala:mainfrom
dotty-staging:solal/optimize-stdlib

Conversation

@SolalPirelli
Copy link
Copy Markdown
Contributor

Fixes #25688

How much have you relied on LLM-based tools in this contribution?

not

How was the solution tested?

existing tests that were recently ported

@SolalPirelli SolalPirelli added the needs-minor-release This PR cannot be merged until the next minor release label Apr 2, 2026
}

val rSum = r.sum(mynum)
val rSum = r.sum(using mynum)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

noticed this as a warning in compilation output, I must've missed it when porting the scalacheck stuff

@SolalPirelli SolalPirelli requested a review from tgodzik April 2, 2026 11:32
Compile / unmanagedResourceDirectories := Seq(baseDirectory.value / "resources"),
Compile / compile / scalacOptions ++= Seq(
/* TODO: enable for Scala 3.9: "-opt", "-opt-inline:**,!java.**", */
"-opt", "-opt-inline:**,!java.**",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we might still need 3.9, @WojciechMazur or we just do 3.8.4-RC2 with the backported regression?

@sjrd
Copy link
Copy Markdown
Member

sjrd commented Apr 2, 2026

If we put this directly into the default config, we must also disable incremental compilation of the bootstrapped library. Inlining from * is incompatible with the incremental compiler, IIRC.

@lrytz
Copy link
Copy Markdown
Member

lrytz commented Apr 2, 2026

We never enabled the optimizer in local development mode in the Scala 2 repo, only in CI for test and release builds. Inlining breaks incremental compilation indeed, and also increases compile times.

On the other hand, in Scala 2 bootstrapping is handled outside the sbt build. I don't know how much anyone's workflow is affected by applying it to the bootstrapped build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-minor-release This PR cannot be merged until the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize the stdlib

4 participants