-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ConstraintSystem] Add cache for conformance lookups #63889
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
Conversation
@swift-ci please test compiler performance |
@@ -874,14 +874,12 @@ bool LiteralRequirement::isCoveredBy(Type type, DeclContext *useDC) const { | |||
if (hasDefaultType() && coversDefaultType(type, getDefaultType())) | |||
return true; | |||
|
|||
return (bool)TypeChecker::conformsToProtocol(type, getProtocol(), |
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.
conformsToProtocol() also checks conditional requirements; is that an issue here?
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.
It's actually better if it doesn't check them here, leads to better diagnostics.
Going to re-trigger to pick up source compat fixes from other PRs. |
@swift-ci please test compiler performance |
@swift-ci please test source compatibility |
@swift-ci please test compiler performance |
@meg-gupta @eeckstein I think one of the recent changes to CSE optimization pass introduced a non-deterministic crash, this time “new” built but “old” crashed (that is the version of the compiler without any modifications introduced by this PR), last time “new” crashed this way. Could you please take a look? |
@xedin Thanks. I'll take a look. |
This isn't related to CSE. A non-ossa function has ossa instructions like move_value tripping the hash value computation. Should be a simple fix, I'll try to track it down. |
@meg-gupta Thank you very much! |
@swift-ci please test compiler performance |
@swift-ci please test source compatibility |
@swift-ci please test |
@swift-ci please test source compatibility |
@swift-ci please test macOS platform |
69315fb
to
0e8bf17
Compare
`lookupConformance` request is not cached and constraint solver performs a lot of them for the same type (i.e. during disjunction solving), let's try to cache previously performed requests to see whether additional memory use is worth the performance benefit.
0e8bf17
to
32d2651
Compare
@swift-ci please test compiler performance |
Summary for main fullNo regressions above thresholds Debug-batchdebug-batch briefRegressed (0)
Improved (1)
Unchanged (delta < 1.0% or delta < 100.0ms) (1)
debug-batch detailedRegressed (0)
Improved (5)
Unchanged (delta < 1.0% or delta < 100.0ms) (325)
Releaserelease briefRegressed (0)
Improved (1)
Unchanged (delta < 1.0% or delta < 100.0ms) (1)
release detailedRegressed (0)
Improved (4)
Unchanged (delta < 1.0% or delta < 100.0ms) (326)
|
@swift-ci please test |
I think we should land this. |
lookupConformance
request is not cached and constraint solver performs a lot of them for the same type(i.e. during disjunction solving), let's try to cache previously performed requests to see whether additional
memory use is worth the performance benefit.