You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both Scalac and Dotty use hand-written hashtables to represent scopes. Moreover, Kentucky Mule also uses hand-written hashtables, highlighting the fact that they perform better than j.u.HashMap. Let's see how alternative representations for scopes will affect our performance.
The text was updated successfully, but these errors were encountered:
I don't know until which point this may be of interest, but from the kentuckymule notes:
I started with representing a Symbol as wrapper around a mutable HashMap[Name, ArrayBuffer[Symbol]] that holds stores its children. Benchmarking showed that symbol table can be populated with symbols from Typer.scala the rate of 85k full symbol table creations per second. Switching from Scala's mutable Map to Guava's MultiMap improved the performance from 85k to 125k per second.
Later work on fixing bugs decreased the performance to 113k ops/s in BenchmarkEnter.enter (using the tree from parsing Typer.scala). Switching from a combo of MultiMap and ArrayBuffer to Scope (borrowed almost verbatim from dotty) increased performance to 348k ops/s. This is an astonishing performance gain and shows the power of a specialized, highly optimized data structure.
After doing preliminary experimentation with the "Benchmark architectural change XXX" tickets, we found out that performance effects of many of these changes lie within the range of run-to-run variance of our current benchmark suite. This makes it hard to form an informed judgement about these changes, so we decided to postpone further experiments until we implement support for more language features and make our benchmark suite more diverse.
Both Scalac and Dotty use hand-written hashtables to represent scopes. Moreover, Kentucky Mule also uses hand-written hashtables, highlighting the fact that they perform better than j.u.HashMap. Let's see how alternative representations for scopes will affect our performance.
The text was updated successfully, but these errors were encountered: