GTMLoadTimer is a framework to instrument Objective C +load calls to see how they are contributing to yourapplication startup time.
- Add a dependency on either the GTMLoadTimer-macOS or GTMLoadTimer-iOS framework to your project.
- Do a build and verify that the framework is copied into the Frameworks directory of your application bundle.
- Build the "Instrument" target of the GTMLoadTimer project.
- Go to the Finder and "open" the GTMLoadTimer.instrdst package you just built. It should ask to install intoInstruments.
- Create a new "blank" instrument in Instruments and add the "+load messages" instrument.
- Record your app with your instrument.
The data that you are probably most interested in is the+load messages
graph which will show you timings foreach of the+load
messages that the framework has swizzled.The "swizzler" track is just to make you aware of the overhead of using GTMLoadTimer.
Please do not ship GTMLoadTimer in your applications.
As far as I know there is nothing that GTMLoadTimer does that breaks any of Apple's rules with regards to theAppStore in that it only uses public APIs. That being said, all it will do is slow down launch time for your end userswhich is not cool.
What would be cool is if Apple built this functionality into libObjc directly so that GTMLoadTimer wasn't needed at all.If you feel the same, please file a radar to let Apple know you care. Feel free to reference my radar on this issue(47260318).
This is not an officially supported Google product.