Closed mdedetrich closed 9 months ago
I wish I had backported the improved optimi(s/z)er options. IIRC there was only a bit of tweaking for options to parse it correctly.
The new syntax is just -opt:inline:<sources>
for inlining power and -opt:local
for minimum strength safety.
This PR enables the Scala2 optimizer to squeeze out some extra free performance. Since the project has both a
core
part and acli
part the optimizer is enabled differently for eachcore
: As the core is published as part of ci-release, the optimizer is only enabled in CI (i.e. github actions). It also uses"-opt-inline-from:<sources>"
which is the most conservative option designed for libraries (i.e. it only optimizes the sources within each sbt module individually)cli
: Since thecli
is designed to be distributed as an application/executable (i.e. we create a fatjar via sbt-assembly) we can take advantage of this and do global optimization. There are 2 types of global optimization, one is optimizing everything including the JDK and the other is optimizing everything aside from the JDK (i.e. inside thescala.tools.jardiff
package). I opted to go for thescala.tools.jardiff
package because we are also distributing the fatjar generally as an artifact in github so we can't control what JDK the user runs on. Note that while it may seem like the difference between<sources>
andscala.tools.jardiff
is negligible now it will matter more when more sbt modules made (i.e. an additional one aside from core) since it globally inlines everything form that package (which as a fatjar is generally safe).