Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce allocations in TypingTransformer based phases #76

Open
wants to merge 11 commits into
base: 2.13.x
Choose a base branch
from

Conversation

retronym
Copy link
Owner

@retronym retronym commented Oct 22, 2019

Fixes scala/scala-dev#519

0.977693534x allocation reduction for compiling catsJVM

[info] HotScalacBenchmark.compile:·gc.alloc.rate.norm                       ../corpus           latest                    false  2.13.2-bin-05d028e-SNAPSHOT  @/Users/jz/code/cats/core/.jvm/target/cats-core-compile.args  sample   25  2558738109.440 ±   4386033.970    B/op
[info] HotScalacBenchmark.compile:·gc.alloc.rate.norm                       ../corpus           latest                    false  2.13.2-bin-4f284a8-SNAPSHOT  @/Users/jz/code/cats/core/.jvm/target/cats-core-compile.args  sample   25  2500535622.400 ±   2013538.465    B/op

TODO:

  • Make LightTypingTransformer an abstract class rather than a trait to speed up the type test.
  • Document the reason it isn't used for superaccessors (that stores local typers). Or maybe look at refactoring superaccessors to be less weird.
  • Think about patmat's current reliance on implicit search working in typechecking for Array patterns. To witness this, modify typer to disable implicit search after the typer global phase. After this change, LightTypingTransformer based localTyper-s would no longer pick up in scope implicits contributed by enclosing members. It already ignores in-scope implicits that were made available via imports, as the Import nodes are dropped in refchecks.

@retronym retronym force-pushed the faster/typing-transformer branch 3 times, most recently from 4f284a8 to 093d26a Compare October 23, 2019 08:00
@retronym
Copy link
Owner Author

@adriaanm @hrhino Just FYI, this is the work I mentioned yesterday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant