Various performance optimizations / experiments [ci: last-only]#5785
Various performance optimizations / experiments [ci: last-only]#5785retronym wants to merge 114 commits intoscala:2.12.xfrom
Conversation
Any types that needed to be specialized to support callsites in the current run would have already been info transformed during the specalization tree transform of those call sites. The backend requires further type information, e.g, to know about inner/enclosing class relationships. This involves calls to `sym.info` for classes on the classpath that haven't yet been info transformed. During that process, all base classes of such types are also info transformed. The specialization info transformer for classes then looks at the members of the classes to add specialialized variants. This is undesirable on grounds of performance and the risk of encountering stub symbols (references to types absent from the current compilation classpath) which can manifest as compiler crashes.
Avoid use of BoxesRuntime equals in favour of direct use of Object#equals.
This reverts commit 30a440a.
| case ArrayBType(component) => "[" + component | ||
| case MethodBType(args, res) => "(" + args.mkString + ")" + res | ||
| final override def toString: String = { | ||
| val builder = new StringBuilder(64) |
There was a problem hiding this comment.
You can save an extra allocations here by using the java StringBuilder directly.
There was a problem hiding this comment.
Ignore me I think you did the change in another commit.
|
I haven't managed to get the benchmark server producing stable enough results, so I performed benchmarking locally. Results Hot compilation of The benefits will vary somewhat depending on the codebase being compiled, e.g. @rorygraves reports a 22% improvement for compiling There are a few commits that appear to be clear winners, and then many that are hard to reason about in isolation as the individual performance changes are around the same level as the noise in the benchmark. I'm going to close this pull request an submit smaller PRs, starting with changes that have the best cost/benefit ratio (easy to review patches / big performance improvement). |

Puship WIP here to facilitate benchmarking.