Created attachment 8358060 [details] Profile of Settings App From the attached profile, we see we spend 218 ms loading an optional homescreen setting by iterating through all the apps to see if they homescreens. This causes large jank after a cold launch.
Created attachment 8358062 [details] Profile of Settings App w/ Patch We remove the homescreen search from the startup path, going from 218 ms down to 54 ms, saving 164 ms
Comment on attachment 8358165 [details] [review] https://github.com/mozilla-b2g/gaia/pull/15178 Adding an arbitrary 5s timeout doesn’t sound like the best possible fix. Using non-zero timeouts is not healthy. If that’s really the only patch you can propose for this bug, we’d need: • a global all-caps constant at the beginning of the file instead of a local “delay” variable; • a comment explaining why we rely on such a hack; • another reviewer (e.g. :arthurcc), because I’d probably still not r+ it. :-p As I wrote on github, I think you probably want to use a callback or an event listener instead.
Created attachment 8358663 [details] Profile of Settings App w/ Patch
Triage: please nominate for approval.
Comment on attachment 8358695 [details] [review] https://github.com/mozilla-b2g/gaia/pull/15219 Thanks for finding the performance hotspot and the patch. A few comments: 1. Can we add an idle observer in try_show_homescreen_section.js so that we don't need the custom event? 2. We don't need to store the installed homescreen count in the async storage as we always check it every time we launch settings app. 3. To save the refresh time when app installed/uninstalled, we can only check if the installed/uninstalled app is a homescreen app or not instead of get all apps again.
Created attachment 8359925 [details] Profile of Settings App w/ Patch Down to 51 ms im try homescreen count.
Comment on attachment 8359927 [details] [review] https://github.com/mozilla-b2g/gaia/pull/15317 I hate that we have to do this, but you can't deny the benefit. I wonder if there is some nicer long term approach, maybe caching the HTML somehow.
Comment on attachment 8359927 [details] [review] https://github.com/mozilla-b2g/gaia/pull/15317 Please check my github comments, thanks!
Comment on attachment 8359927 [details] [review] https://github.com/mozilla-b2g/gaia/pull/15317 Updated with your feedback.
Comment on attachment 8359927 [details] [review] https://github.com/mozilla-b2g/gaia/pull/15317 r=me. Thanks!
Created attachment 8361200 [details] [review] https://github.com/mozilla-b2g/gaia/pull/15419 Carrying r+ and f+ from arthurcc and kgrandon.
Landed: master: 13e6907011212fffe6284862638aa84d4b407123 v1.3: 6d0a735f4e69c2151980afa38c05050ef74beb96 Thanks arthur!
Requesting v1.3+ status as this solved bug 951221.