-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[5.1] [Runtime] Add caching based on ABI name to _findContextDescriptor. #26581
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
DougGregor
merged 8 commits into
swiftlang:swift-5.1-branch
from
DougGregor:runtime-find-context-descriptor-cache-5.1
Aug 9, 2019
Merged
[5.1] [Runtime] Add caching based on ABI name to _findContextDescriptor. #26581
DougGregor
merged 8 commits into
swiftlang:swift-5.1-branch
from
DougGregor:runtime-find-context-descriptor-cache-5.1
Aug 9, 2019
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…tensions When looking for a context descriptor for a protocol extension, we search based on the mangled name--"x", a generic type parameter with depth and index 0--and are guaranteed to fail because there is no such concrete type. However, _findContextDescriptor will fail very slowly, spinning through all of the types and conformances in all of the loaded images. Moreover, negative results aren't cached, so this can happen repeatedly. Short-circuit _findContextDescriptor when it receives a dependent generic type parameter type, avoiding the expensive search when it will find nothing. Potential fix for rdar://problem/53560010.
This is a one-to-many cache that's more speculative than the cache mapping mangled names to context descriptors. Entries found in the cache need to be verified for a match before they can be returned. However, this allows scanning conformance records up front and building up the cache in one scan rather than performing an expensive scan of all conformance records every time the mangled name cache misses. rdar://problem/53560010
…a TinyPtrVector to avoid duplicates.
@swift-ci please test |
Build failed |
This doesn't look related at all: /home/buildnode/jenkins/workspace/swift-PR-Linux/branch-swift-5.1-branch/tmp/TemporaryDirectory.AQQvUn/pkg/Package.swift:3:5: error: type annotation missing in pattern
13:29:59 let pack
13:29:59 ^ |
@swift-ci please test Linux |
1 similar comment
@swift-ci please test Linux |
AnnaZaks
approved these changes
Aug 9, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a one-to-many cache that's more speculative than the cache mapping mangled names to context descriptors. Entries found in the cache need to be verified for a match before they can be returned. However, this allows scanning conformance records up front and building up the cache in one scan rather than performing an expensive scan of all conformance records every time the mangled name cache misses.
rdar://problem/53560010