scala/scala — pull request #3095 by retronym (2013-11-01 10:54:18+00:00)
Title: Don't use runtime reflection from the batch compiler.

Not only does this save a big chunk of time on startup by avoiding
classloading and symbol table population, but it also seems to
improve steady state performance of the compiler.

Theory: JIT can optimize more aggressively without the
SynchronizedXxx decorators and the like being in the classloader.
See "Class Heirarchy Analyis" in [1]

This commit does this by:

- Avoiding use of FromString in pattern matcher, instead
using an established mechanism to parse system properties.
- Changes FromString back to use OptManifest. AFAICT, this
is now only a dependency of scala.tools.cmd.gen.Codegen,
so this is just a defensive measure.

The REPL still uses runtime reflection, so will pay a little
performance tax.

Benchmark:

avg shortest 10 times 744ms # before
avg shortest 10 times 675ms # after

[1] https://wikis.oracle.com/display/HotSpotInternals/PerformanceTechniques