I am debugging the slow launch of an iPhone application (Xcode, Objective C ++). This is a tab-based application with three tabs. All three tabs are loaded into one NIB - about 20 objects in total.
The first round of significant initialization occurs in the viewDidLoad handler of the first tab view controller. However, between the main () and the start time of this method, it takes about 1 second - about 2/3 of the total load time. Question: what happens during this time, and how can I investigate this (without waiting for disassembly)? As far as I know, between two points there is no my code - the delay occurs completely in the system code.
Maybe some Tool that can give me a time profile for each function?
The package is ~ 4 MB, but I upload the largest file (~ 3.5 MB) later than this to the applicationDidFinishLaunching handler. Removing this file from the package and commenting on the corresponding code does nothing for this 1 second delay.
UPDATE: still there was a debugging intervention. If I launched it on the device while watching the console, the launch time is much shorter, and the proportion of the system delay code on my code is also distorted. But, nevertheless, there is a noticeable delay between main and viewDidLoad, and this is about 50% of the total load time.
By the way, of all the methods of loading a fairly large file from a package into memory, the fastest of them was direct memory mapping (using POSIX mmap ()).
source share