MobileNativeFoundation / XCLogParser

Tool to parse Xcode and xcodebuild logs stored in the xcactivitylog format
Apache License 2.0
1.73k stars 121 forks source link

swiftTypeCheckTimes and swiftFunctionTimes only appearing for main application target #100

Closed birwin93 closed 3 years ago

birwin93 commented 3 years ago

Using xclogparser v0.2.18

I've been playing around with using -Xfrontend -debug-time-expression-type-checking -Xfrontend -debug-time-function-bodies to analyze what functions and type checkers are slowing down our build times.

I've noticed that only the source files in the main application target seem to have swiftTypeCheckTimes and swiftFunctionTimes populated. All the source files in our dynamic frameworks and static libraries don't though. I've confirmed those targets are also built with the correct compiler flags, and that the method/typechecks + durations are in the build logs in xcode.

Any ideas? Thanks!

birwin93 commented 3 years ago

It does look like the information is also in the output from running xclogparser dump

ecamacho commented 3 years ago

Hi! do you have an xcactivitylog to reproduce the error? If you can't provide one, can you share the overall structure of your project to try to mimic it?

birwin93 commented 3 years ago

Thank you for the quick reply!

Unfortunately I can't share our xcactivitylog. But general structure:

Not sure if it matters, but we use XcodeGen as well

Let me know if you need anymore info!

birwin93 commented 3 years ago

Hmmmm I actually created a sample project to try and get an xcactivitylog with a similar setup and it worked fine. Must be something weird in our setup. May also just be a complexity issue since our repo is pretty large with tons of chained dependencies.

FWIW some of our dynamic frameworks have objective c code in them, if that matters.

birwin93 commented 3 years ago

I might try to clone XCLogParser and see if I can figure out what's not working. Any hints on where in the codebase to focus on?

birwin93 commented 3 years ago

Did some more digging. Turns out being in frameworks was a red herring. Ended up being related to spaces in file paths. Put up a PR here to fix: https://github.com/spotify/XCLogParser/pull/102

ecamacho commented 3 years ago

Thank you for the PR!