scala-dev
scala-dev copied to clipboard
Reduce optimizer running time and memory pressure
The use of ASM Analyzers in the inliner/optimizer is very allocation heavy. This can be observed easily with a profiler, there is basically constant minor GC going on as soon as the compiler reaches the backend.
The best way to improve on that is probably to run fewer analyzers, i.e., to fuse local optimizations that use the same kind of analysis.
This would also improve the time it takes to run the optimizer. By far the most amount of time is spent in the SourceValue
analysis, which computes producers and consumers. This analysis is used in a number of places
- rewrite closure invocations
- push-pop
- box-unbox
- remove stale stores
It might be possible to fuse the local optimizations that use this analysis into one.