Skip to content

Conversation

augusto2112
Copy link

@augusto2112 augusto2112 commented Jul 7, 2022

rdar://87889973
(cherry picked from commit 5931c1e)

Description: Currently, whenever we're asked to retrieve a particular FieldDescriptor for a TypeRef, we naively parse all the ReflectionInfos in the order they were registered (caching everything) until we find the one we're looking for. This can be very costly for the debugger, as we may be reading memory from a remote target. This patch introduces a heuristic to prioritize this search by processing first ReflectionInfos where the FieldDescriptor we're looking for is likely to be. If the heuristic fails, we fallback to the old behavior. In profiling debugging large apps, this has significant impact on the time to stop on the first breakpoint.
Risk: Low. If the heuristic fails we fall back to the old behavior.
Testing: swift lldb tests that use frame variable.
Original PR: #4927
Issue: rdar://87889973

@augusto2112 augusto2112 requested a review from JDevlieghere July 7, 2022 23:11
@augusto2112
Copy link
Author

@swift-ci test

Copy link

@JDevlieghere JDevlieghere left a comment

Choose a reason for hiding this comment

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

LGTM

@JDevlieghere JDevlieghere merged commit ecf60f9 into swiftlang:swift/release/5.7 Jul 8, 2022
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.

2 participants