New issue
Advanced search Search tips

Issue 831768 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Layout inflation happens on UI thread during activity onCreate

Project Member Reported by mheikal@chromium.org, Apr 11 2018

Issue description

Layout inflation takes about 200-300ms on lower end devices. It is
currently done during oncreate way early during startup. It is however
not actually needed until much later (initializeCompositor step).

Inflating the layout in a background task should improve startup performance.
 
After analysis of trace with and without BG inflating here are the observations. Inflating the real layout takes 200ms however inflating the fake layout takes 75ms.

I feel that the layout inflation time for the fake layout is very high. 75ms for an almost empty layout seems weird but I am not sure what can be done there.
with_patch_2-cold-webapk-10s~40_15.html
10.5 MB View Download
no_patch_3-cold-webapk-10s~40_25.html
11.5 MB View Download

Comment 2 by dskiba@chromium.org, Apr 11 2018

We don't need fake layout for WebApks though, because there is a splash screen. I think we need to land support for inflating ChromeActivity layout in the background, and then use that in WebApps.
Good point, I no longer do any fake layout for WebAppActivity and setContentView is now much faster (4ms) however AsyncInitializationActivity is still taking the same amount of time. I am not sure where it is going now.

Current CL here: cl/1008405
output.html
10.2 MB View Download
After some tracing, WebappActivity.initializeWebappData takes 8ms if a fake layout is inflated but 120ms if no fake layout is inflated. Most of the time is spent idle/blocking.
fake.html
10.6 MB View Download
nofake.html
10.7 MB View Download
In WebappActivity.initializeWebappData, findViewById(android.R.id.content) takes 86ms if no fake layout is set.
nofake.html
10.9 MB View Download

Sign in to add a comment