Startup timing measurements unreliable in iOS15 #146
Replies: 6 comments 12 replies
|
If you're using a method similar to https://eisel.me/startup, it's likely caused by // With iOS 15 pre-warming, initializers and other pre-main steps are run preemptively, potentially hours before the
// app is started and main() is run. So, take the difference between process start time in pre-main initializer
// (which we control with this "constructor" attribute) and add that later with post-main time.
// NOTE: any initializers run after this will not have their startup time impact included. We try to make this
// initializer go first using a priority of "0", but there are no guarantees.We are (at this point) just excluding measurements from iOS 15 until we have time to revisit calculating it in a more correct way. |
|
@michalkalinowski- Your findings match ours. We saw some extremely long tails in our app launch metrics for users on iOS 15. For now we've just been excluding durations longer than 10 minutes (kind of arbitrary). It's definitely a bummer that even with this workaround, initialization time isn't reliably captured. Here's a good article on how this mechanism works if you haven't seen it. |
|
@michalkalinowski- @cwalo I'm keen to clarify where exactly you're seeing this increase. As @mattrobmattrob mentioned, the |
|
@ileitch We start measuring from process start time. @michalkalinowski- Ditto, can you clarify your launch span? Also curious to know how exactly you're using |
Tl;drThere's a few things that could be happening here, but tl;dr, I would highly recommend AGAINST rolling your own solution. Use the perf data that MetricKit.framework (in production) and XCTApplicationLaunch (for UI Testing) provide. They are the two most reliable data sources because they use the OS values from internal systems (e.g Springboard and Launchd) which govern the launch process. Those values are only exposed through this API (I know because I helped write them) and are the same one's used to do things like determine if the OS should kill your application. For science only ™️The Another possibility is that the application is simply being killed on startup (e.g dyld_prewarm as previously mentioned) and the next time someone opens the application you're measurement is accurate in that the successful launch was X days / hours after. Off the top of my head, those would be my best guesses. But again, don't roll your own solution for measuring perf here, use MetricKit/XCTest. |
|
This twitter thread is also highly relevant
|
Uh oh!
There was an error while loading. Please reload this page.
Hello all,
I'm an iOS dev working on mobile apps at Yelp. We're tracking startup time of our apps and since the release of iOS15 we've started seeing large number of startup time events with unreasonably large durations. At this point the "large duration events" add up to almost 20% of all the events reported by iOS15 clients which is worrisome.
I've heard from devs working on other apps they see similar large duration events so I thought I'd reach out to the community to check if anyone has any clue about the root cause.
What we know so far:
Details of our perf measurement setup:
mainmach_absolute_time()which we assume is guaranteed to be a monotonic clock (docs)Is anyone else seeing similar noise in startup time measurements in their apps? Any clue on what's the root cause?
All reactions