DAY #66

You can profile swift’s compilation performance in an Xcode project with:

1
  xcodebuild -workspace App.xcworkspace -scheme App clean build OTHER_SWIFT_FLAGS="-Xfrontend -debug-time-function-bodies" | grep .[0-9]ms | grep -v ^0.[0-9]ms | sort -nr > culprits.txt

replacing “App” with your project’s name.

This trick comes from: https://irace.me/swift-profiling

Originally published 10/21/2021 @ https://pittcsc.org/ Discord

Published here on 09/20/2022. Blog published date reflects the original date of publication.