Skip to content

[RemoteMirrors] Put a cache in front of getFieldTypeInfo to avoid repetitive scanning of the target's reflection infos. #16996

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 1 commit into from
Jun 5, 2018

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented Jun 5, 2018

The old code did a linear scan of all the reflection info on each lookup, throwing away the information it got about the stuff it scanned over on its way to what it was looking for. When looking up lots of different things, this results in a lot of wasted time and bad performance.

This change stores the scanned info into a cache which can be used for subsequent lookups. It also scans to the end even when the target is found somewhere in the middle, to make it more likely that subsequent lookups will be cached.

rdar://problem/40705238

…etitive scanning of the target's reflection infos.

rdar://problem/40705238
@mikeash
Copy link
Contributor Author

mikeash commented Jun 5, 2018

@swift-ci please test

Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

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

This is great!

@slavapestov
Copy link
Contributor

LGTM

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