(Async commit?) Scrolling on http://www.carmelvalleyranch.com/ is very slow |
|||||
Issue descriptionGoogle Chrome 54.0.2840.93 (Official Build) (64-bit) Revision 0 Platform 8743.83.0 (Official Build) stable-channel samus This is on a Pixel 2, so it's high end hardware and high DPI. What steps will reproduce the problem? (1) Load http://www.carmelvalleyranch.com/ (2) Scroll down until you see the image that does the parallax (3) Scroll up and down. There's several issues on this site: - In the trace you see it sepnds 30-50ms blocked in ProxyMain::BeginMainFrame::commit, blocking the main thread from doing anything else. - It seems to software decode (SoftwareImageDecodeController::DecodeImage) the image that's being moved around with background-position for the parallax effect on *every frame*, even though the image is just changing positions. We shouldn't need to decode it repeatedly.
,
Nov 10 2016
Some background images are converted to draw image calls, so it's possible that we're capturing them as well. Off the top of my head, we don't cache things if they are too big, so maybe this is hitting that limit. I'll take a look.
,
Nov 10 2016
enne@ Should I file a separate bug for the commit stall? We shouldn't block main like that, it's just as bad as doing a sync IPC, it's blocking network request handling, low memory notifications, the preload scanner and more.
,
Nov 10 2016
esprehn: you should talk to sunnyps@ about it and file a bug. This is related to the "begin main frame before activation work". We used to not send the begin main frame and start a commit until activation happened, to leave the main thread free. However, this decreases the amount of pipelining you can do. That said, if you send the begin main frame too early, then the main thread stalls. Maybe it's possible we could use the history of how long historical activation times have been to know when we should send the begin main frame message.
,
Nov 10 2016
Can we make the commit async? We just need to make sure not to progress through the paint code until the commit has finished I think. But JS, style and layout could run.
,
Nov 10 2016
On the image front, it seems that how this animation is happening is by varying the src_rect and upscaling it to some size. However, it turns out that each of the src_rects and upscale size is different each frame. So, although the original image is decoded in memory, the upscaling using a high filter quality is taking up a bulk of the work and it can't be reused since the values are different. Here are three examples (visible in the SoftwareImageDecodeController::DecodeImage slices): id[302] src_rect[0,0 1280x365] target_size[2530x721], then id[302] src_rect[0,0 1280x388] target_size[2530x767], then id[302] src_rect[0,0 1280x394] target_size[2530x779] As far as SIDC knows these are distinct cache entries, although the id is the same. I'm going to grab a trace with cc.debug as well, since it might make it a bit more clear where the time is spent.
,
Nov 10 2016
I'm not fond of adding a heuristic for this. Re: making commit async, there are two ways of doing this: 1. main thread sends commit message to compositor thread, blocks updates to layer tree / shared state until commit completes (what ojan is proposing I think) 2. main thread sends commit ready message to compositor thread, compositor performs synchronous commit i.e. compositor thread blocks for main thread skyostil/alexclarke: for option 2 can blink scheduler guarantee that we don't block compositor thread for a long time?
,
Nov 10 2016
Yeah, I think it would be good to clear up the page lifecycle to avoid a stall. Even without MFBA, ProxyMain::BeginMainFrame::commit() is a synchronous IPC and can block several ms, as in the attached trace.
,
Nov 10 2016
I propose we split this patch into two; One to investigate the images, one for async commit. I've filed crbug.com/664251 to track the image component.
,
Nov 10 2016
s/patch/bug/
,
Nov 10 2016
vmiura: BeginMainFrame::commit taking a long time on complicated pages is a separate issue and has existed for a very long time. There's a tradeoff between doing extra work to make the commit asynchronous and just doing it synchronously when it's usually fast. I think we're already pretty committed (<_<) to making it asynchronous in a future mus world. Personally, I don't think it's a high priority to change this in the short term. The difference with MFBA is that now BeginMainFrame is blocked on activation of the previous frame, so with very slow decodes and raster it becomes ten times worse, which seems like a much more real problem. At any rate, I think it should be a different bug as well if you want to talk about that.
,
Nov 10 2016
enne: I agree this is a much bigger problem. I just assumed the solution could be the same. I guess I think the historic timing approach seems a bit brittle, and would like to understand the async commit options.
,
Nov 10 2016
I think we need both the activation time heuristic and an async commit of some sort. Otherwise, even with an async commit, we will end up doubling an already large latency. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by enne@chromium.org
, Nov 10 2016Status: Available (was: Untriaged)