-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Cache AnnotatedTypes #9743
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
Cache AnnotatedTypes #9743
Conversation
This leads to an increase of cachable applied types. For typer/*.scala: cached applied types uncached applied types now 32.3K 0.4K was 30k 12.4K # Conflicts: # compiler/src/dotty/tools/dotc/core/Types.scala
Since we are always comparing annotations in AnnotatedTypes with `eq`, they should always be hashed with identityHashCode.
Annotations contain a tree whose hash is not stable, how does caching works for them? |
@smarter Annotations are hashed and compared with |
Right, but for caching to be useful that means we need to reuse the same tree instance in multiple Annotations, I'm curious in what situation this could happen? |
I believe the wins are more for types containing annotated types. Previously, since annotated types were not cached any type containing them was not cached either. The numbers in the PR message show this clearly: We go from 42.4k AppliedTypes to |
test performance please |
performance test scheduled: 3 job(s) in queue, 1 running. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/9743/ to see the changes. Benchmarks is based on merging with master (101e620) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This leads to an increase of cachable applied types. For typer/*.scala: