You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Allow injection of extra settings in to the build
- Parameterize the command name used to compile.
- Create a custom "compileRaw" task in the build (for SBT 0.13.x, the
API I'm using must have shifted in 1.0.x)
Testing a local build of SBT that disables its metadata collection compiler phases
when `antStyle = true`.
```
sbt> set scalaVersion in compilation := "2.12.3-bin-d1ec01a-SNAPSHOT"
sbt> compilation/jmh:run HotSbtBenchmark -psource=scalap -psbtVersion=0.13.16-bin-7b5d818 -pextraBuild=incOptions:=incOptions.value.withNameHashing(false).withAntStyle(true)
...
[info] Benchmark (compileCmd) (corpusVersion) (extraArgs) (extraBuild) (sbtVersion) (source) Mode Cnt Score Error Units
[info] HotSbtBenchmark.compile a8c43dc incOptions:=incOptions.value.withNameHashing(false).withAntStyle(true) 0.13.16-bin-7b5d818 scalap sample 330 956.082 ± 7.116 ms/op
```
Bypassing the `compile` task altogether in favour of user of SBT's `RawCompiler`.
```
sbt> compilation/jmh:run HotSbtBenchmark -psource=scalap -psbtVersion=0.13.15 -pcompileCmd=compileRaw
[info] Benchmark (compileCmd) (corpusVersion) (extraArgs) (extraBuild) (sbtVersion) (source) Mode Cnt Score Error Units
[info] HotSbtBenchmark.compile compileRaw a8c43dc 0.13.15 scalap sample 357 888.775 ± 7.243 ms/op
```
The base and top-lines that we're comparing against:
- `HotScalacBenchmark` for the same Scala revision: 765ms.
- `HotSbtBenchmark` using default config and compile task from 0.13.15: 1063ms
Discussion:
- The overhead of the terminal scraping between the JMH benchmark process and the child SBT process might be a factor here. Try a larger codebases to reduce that effect.
- The SBT compiler phases appear to levy only ~12% overhead, which seems quite reasonable.
- We need to find out what other factors are preventing the results above from coming in closer to the direct compiler usage.
0 commit comments