iosobjective-cdependency-injectiontyphoon

IOS application with Typhoon is launched too slow


I use Typhoon 3.6.0 for dependency injection in my iOS app written in Objective-C. There are more than 3000 TyphoonDefinition's in the app. Currently app launch time is more than 4 sec.

enter image description here

enter image description here

Xcode TimeProfiler shows that Typhoon swizzles each Typhoon definition in project when app launched. That's why it takes so long.

How can I optimize Typhoon startup and reduce app launch time?


Solution

  • Use Typhoon 4.0.0 because it uses proxies rather than swizzling to instrument application assemblies - startup time with very large assemblies is much faster.

    If you're still seeing startup times that are slower that desired, and you don't need auto-wiring, that can be disabled.

    Finally, if you prefer Swift, you might wish to use the new Swift version of Typhoon. From an end-user point of view it is very similar, however in the spirit of ARC and Swift it uses compile-time instrumentation rather than runtime.