Skip to content

Instantly share code, notes, and snippets.

@hannesoid
Created November 16, 2016 13:39
Show Gist options
  • Save hannesoid/3be6a175f442d1e3f78895fd22441515 to your computer and use it in GitHub Desktop.
Save hannesoid/3be6a175f442d1e3f78895fd22441515 to your computer and use it in GitHub Desktop.
Measure Swift Compile Times

List swift functions by slowest compile time (minimum 2-digit milliseconds):

$ xcodebuild -workspace MyProject.xcworkspace -scheme "MyProject" clean build OTHER_SWIFT_FLAGS="-Xfrontend -debug-time-function-bodies" | grep '^[0-9][0-9][0-9]*\.[0-9]*ms' | sort -n

If you want to see the compile times in Xcode build report add to build settings "other swift flags": -Xfrontend -debug-time-function-bodies

Sources

http://stackoverflow.com/questions/31520133/output-compile-durations-for-swift-files http://yurikarabatov.com/en/tags/ios/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment