Emanuel needs to attract extra consideration to this query:
The reply ought to present a exact approach to make sure we are able to seize the time spent on First Body rendered as proven by the App lifecycle Instrument (in Devices App).
I am implementing telemetry for our app, one of many issues I am attempting to seize are the distinct blocks of time as described by Apple engineers within the Optimizing App Launch video of WWDC 2019. I am having a tough time capturing exactly the time for the First body and the prolonged levels.
I am attempting to seize them as within the snippet under and I am utilizing signposts to signify the factors of logging (with each log..Began and log…Completed. The belief I am making are:
That the appliance:didFinishLaunchingWithOptions: technique is being known as earlier than the primary body is rendered (as described within the video)
The primary body shall be completed rendering after the present runloop ends.
void PerformWhenIdle(dispatch_block_t block) {
CFRunLoopObserverCreateWithHandler(kCFAllocatorDefault,
kCFRunLoopAfterWaiting,
NO,
0, ^(CFRunLoopObserverRef observer, CFRunLoopActivity exercise) {
block();
});
}
// —————————-
// AppDelegate.m
– (BOOL)utility:(UIApplication *)app didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[logger logFirstFrameRenderingStarted];
PerformWhenIdle(^{
[logger logFirstFrameRenderingFinished];
[logger logExtendedStageStarted];
});
}
// —————————-
// in TableVC.m
– (void)viewDidAppear {
[self.tableView reloadData];
PerformWhenIdle(^{
[logger logExtendedStageFinished];
});
}
Looks as if the start line for the primary body is sort of shut after I examine the signposts in devices, nonetheless the primary body appears fairly off and subsequently the prolonged stage appears very quick as compared, the place the signpost point out a length of 225.23ms the App lifecycle instrument reveals it took 1.78ms:
I would prefer to know
Are my assumptions incorrect? if sure does it imply the instrument is unsuitable?
If they’re incorrect, how can I finest seize the beginning and end factors of the primary body being rendered?