Skip to content

Better caching of prototypes #9742

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

Merged
merged 4 commits into from
Sep 8, 2020
Merged

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Sep 7, 2020

  • Make IgnoredProto a cached type
  • Convert IgnroedProtos to WildcardTypes in wildApprox
  • Use eql instead of equals when hash-consing prototypes

 - Make IgnoredProto a cached type
 - Convert IgnroedProtos to WildcardTypes in wildApprox
 - Use `eql` instead of `equals` when hash-consing prototypes
@odersky
Copy link
Contributor Author

odersky commented Sep 7, 2020

test performance please

@dottybot
Copy link
Member

dottybot commented Sep 7, 2020

performance test scheduled: 2 job(s) in queue, 1 running.

@dottybot
Copy link
Member

dottybot commented Sep 7, 2020

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/9742/ to see the changes.

Benchmarks is based on merging with master (d11e137)

This reverts commit 83e6ad4.

Also, optimize trace further to be zero overhead

# Conflicts:
#	compiler/src/dotty/tools/dotc/reporting/trace.scala
@odersky
Copy link
Contributor Author

odersky commented Sep 7, 2020

test performance please

@dottybot
Copy link
Member

dottybot commented Sep 7, 2020

performance test scheduled: 2 job(s) in queue, 1 running.

@dottybot
Copy link
Member

dottybot commented Sep 7, 2020

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/9742/ to see the changes.

Benchmarks is based on merging with master (101e620)

Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

(name eq that.name) && (memberProto eq that.memberProto) && (compat eq that.compat) && (privateOK == that.privateOK)
case _ =>
false
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the slight difference between equals and eql have a semantic difference or only a performance difference? In any case, for maintainability, it is worth some explanation here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only for performance.eql does a eq on all recursive calls, knowing that all elements are already hash-consed. I'll add an explanation in one of the next PRs

@odersky odersky merged commit a3c81dd into scala:master Sep 8, 2020
@odersky odersky deleted the cache-proto branch September 8, 2020 11:41
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.

3 participants