scala-dev
scala-dev copied to clipboard
Scala 2 team issues. Not for user-facing bugs or directly actionable user-facing improvements. For build/test/infra and for longer-term planning and idea tracking. Our bug tracker is at https://github...
One of the compiler performance issues I found in a codebase involved a big session of type inference + LUBbing in code creating a `Map[A, Seq[Class[_
Consider this benchmark. ```scala package scala.scratch import java.util.concurrent.TimeUnit import org.openjdk.jmh.annotations._ import org.openjdk.jmh.infra.Blackhole @BenchmarkMode(Array(Mode.AverageTime)) @Fork(2) @Threads(1) @Warmup(iterations = 20) @Measurement(iterations = 10) @OutputTimeUnit(TimeUnit.NANOSECONDS) @State(Scope.Benchmark) class CakeBenchmark { val g = new...
I think we could avoid this by first checking `MethodType.isTrivial` (which is cached) to avoid this call. We might also be able avoid it under `phase.erasedTypes`. - [ ] Add...
Profiles reveal a hotspot at: ```scala case TypeRef(_, sym, _) if sym.isAbstractType => tp.bounds.hi.typeSymbol isSubClass SingletonClass ``` When `tp` is an `ExistentialType`, which defines: ``` override def bounds = TypeBounds(maybeRewrap(underlying.bounds.lo),...
 It might be worth having a one-element cache in `Global` for each of these. We'd need to make them reusable (ie, the fields become vars and we add a...
I've measured about 2.5% compiler speedup in https://github.com/scala/scala/compare/2.13.x...retronym:opt/typer - [ ] Attribute performance improvements to commits, are they all needed? - [ ] Polish the changes and split into PRs...
isSameType does not correspond to isSubtype the way you'd expected. Specifically, the case for refined types looks wrong (though compact): ``` case (RefinedType(ps1, ds1), RefinedType(ps2, ds2)) => (ps1 corresponds ps2)(_...
https://github.com/scala/scala/pull/6818 makes it relatively convenient to compare the results of a newly written benchmark between different Scala versions. We should use this to seek out performance changes (regressions or progressions!)....
In https://github.com/scala/scala/compare/2.13.x...retronym:faster/transformer-faster?expand=1, I demonstrate an idea I've had for a while to try to optimize our compiler "middle end". - Replace the `atOwner` idiom in `Transformers` with `pushOwner` / `popOwner`....
Flight Recorder logs unusually long JIT compilation times. For instance ` scala.reflect.internal.TreeGen#mkTemplate` reports 680ms to generated 192k of code. The method itself isn't that big, but it uses a bunch...