This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Be more lazy about looking up simulator SDKs on macs
ClosedPublic

Authored by jasonmolenda on Mar 24 2022, 1:49 AM.

Details

Summary

This is a perf fix for when lldb on a mac is iterating through all of the Platforms looking for a good one, and the iOS/watchOS/tvOS simulators all call xcrun to find an SDK. If those SDKs are not installed, the xcruns can be quite expensive. The code today determines the SDK path before it knows if the Platform will create itself or not. When the SDKs are present, these xcrun calls are very inexpensive, but some people have different setups.

This patch passes the names of the SDKs into the central method that decides whether to create the Platform, and only searches for the SDK path via xcrun if this Platform is a match.

Adrian, I think you might have written this? If you'd like to review. Else I can ask around if anyone wants to take a look.

Diff Detail

Event Timeline

jasonmolenda created this revision.Mar 24 2022, 1:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2022, 1:49 AM
jasonmolenda requested review of this revision.Mar 24 2022, 1:49 AM
aprantl accepted this revision.Mar 24 2022, 2:18 PM

Fair word of warning — i've broken more than one LLDB build in the past while messing with this code :-)

So you're basically sinking the calls to GetXcodeSDKPath into PlatformAppleSimulator. That looks safe & good to me!

This revision is now accepted and ready to land.Mar 24 2022, 2:18 PM