Skip to content

Profile + Tune compiler #91

Closed
Closed
@retronym

Description

@retronym

After bootstrapping with the all the latest and greatest in 2.12 (new optimizer, indy functions, no impl classes), a quick test shows performance is about on par with 2.11.8. I tested this by compiling src/library with both compilers.

Analysing the YourKit profiles of the new compiler does show some small opportunities for improvements.

  • Name related operations, addressed by Micro optimise Symbol#fullName scala#4954 (not yet merged to 2.12.x). This needs to be merged forwards to 2.12.x
  • Initialization of TyperDiagnostics#deadCode (which is itself dead code outside of -Ydead-code !)
  • Initialiation of object ArrayInstantiation on every typedSelect (no need for that to be nested where it is, move to TreeInfo.
  • Initalization of Reporter#ERROR. We create a lot more Reporter instances these times, we should try to be less allocation hungry in the common case when hasErrors is false.
  • Consider changing reflect.internal.util.WeakHashSet to use .equals rather than == (to avoid type tests in BoxesRuntimes.equals.

I've got additional ideas and tools that I collected previously here: https://gist.github.com/retronym/86ec6ad9ccd2c22f6148

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions