Image decodes cause 500ms stall in AMP viewer carousel reduction |
||||
Issue descriptionStep to repro: 1) Go to http://jsbin.com/cowiye/6/quiet on Nexus 5/5x/6/6p/etc. 2) Start tracing 3) Click "Go" button 4) Wait until all 6 frames loaded Sample trace is here: https://drive.google.com/open?id=0B0w8IQeoE99FdUlPX3h3ZEVXSFU
,
Jul 23 2016
This is a case that could be helped by image checker-boarding, and other 'async' rendering ideas. I'd like to understand the use in AMP better. This test loads each iframe directly in the visible view which makes them blocking. Doesn't AMP's carousel pre-load iframes off screen (giving us a chance to pre-load this kind of image)?
,
Jul 23 2016
AMP does preload iframes, which would help a bit. This is definitely a slightly more exaggerated case. However, you can probably see a user trying to swipe left-left-left and then hitting the preload limit. Also, the preload still happens on the main thread, which means that they could contribute to jank. Yeah, you're right, checkerboarding is probably the right final resting place for this type of problem.
,
Jul 23 2016
The image decodes do take a while which we can help by preloading images or frankly using smaller images :) In one of my traces, I saw that these were 3264x2448 images, which just takes a while to decode. Image checkerboarding would help here, but then you'd just see a smooth animation but no image which will appear later (I think that might be better, but maybe there are cases where that would be more jarring) This does seem to be performing relatively OK in that it isn't decode the image every frame, but just when the image first appears. Also this trace doesn't look bottlenecked on raster, but rather GPU is swamped. Or am I misinterpreting the trace? It seems like the flush takes a while (70ms or so)
,
Jul 23 2016
I defer to you on any judgement around what's happening. I begin to look pretty ignorant as soon as I exit third_party/WebKit and content/renderer :)
,
Jul 23 2016
> Also this trace doesn't look bottlenecked on raster, but rather GPU is swamped. The trace had GPU framebuffer snapshotting on, so it's bottlenecked by that. With that removed I think GPU is fairly cheap; the two image decodes are part of the janks, but also the main thread work is ~100ms during that time as well.
,
Jul 27 2016
Can this bug be closed given comment #6?
,
Jul 27 2016
,
May 10 2017
I think the GPU was swamped due to constant snapshotting, but the original issue of image decoding blocking for a long time remains. vmpstr@, over to you for reducing image decoding to 0ms.
,
May 10 2017
Looks like both images are jpeg. The async & checkerboarding will help the jank, like Vlad said. But the actual decode time will also improve with the move to SkJpegCodec. |
||||
►
Sign in to add a comment |
||||
Comment 1 by dglazkov@chromium.org
, Jul 22 2016