Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Issue 109153003: Raise the loading priority of in-viewport images. (Closed)

Created:
7 years ago by shatch
Modified:
7 years ago
Reviewers:
eseidel
CC:
blink-reviews, bemjb+rendering_chromium.org, eae+blinkwatch, leviw+renderwatch, jchaffraix+rendering, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

This CL attempts to improve upon the default loading priorities for images. By default, images will start at ResourceLoadPriorityVeryLow and after a layout or during a scroll, anything that's visible will be promoted up to ResourceLoadPriorityLow. In our tests, this was a really nice win on speed-index, with a gain of ~5% on average, at ~14% at the 99th percentile. This was committed as r163110, but rolled back due to performance regressions (https://code.google.com/p/chromium/issues/detail?id=326165) in r163362. Link to previous review: https://codereview.chromium.org/86533002/ From profiling the code, the regression is almost completely from the extra time spent in RenderBox::absoluteContentBox called from RenderBlock::updateStyleImageLoadingPriorities. Refactored the code to early out before calling that. Results of performance tests: Format: 1st line: Original CL <-- Regression 2nd line: Original CL Disabled <-- This should be target performance 3rd line: This CL <-- Hopefully roughly the same as (2) Pages: [floats_50_100.html] 1. Avg floats_50_100: 229.050280ms 2. Avg floats_50_100: 187.935380ms 3. Avg floats_50_100: 190.970400ms Pages: [fixed-grid-lots-of-data.html] 1. Avg fixed-grid-lots-of-data: 727.259726runs/s 2. Avg fixed-grid-lots-of-data: 1404.643989runs/s 3. Avg fixed-grid-lots-of-data: 1419.710566runs/s Pages: [ChangingClassNameShadowDOM.html] 1. Avg ChangingClassNameShadowDOM: 71.947800ms 2. Avg ChangingClassNameShadowDOM: 61.533920ms 3. Avg ChangingClassNameShadowDOM: 61.871240ms page_sets/typical_25.json 1. Avg warm_times: 685.391111ms 2. Avg warm_times: 644.857778ms 3. Avg warm_times: 649.995556ms http___ynet.co.il_ 1. Avg warm_times: 753.111111ms 2. Avg warm_times: 677.000000ms 3. Avg warm_times: 654.666667ms page_sets/intl_es_fr_pt-BR.json 1. Avg warm_times: 406.922222ms 2. Avg warm_times: 397.788889ms 3. Avg warm_times: 399.477778ms robohornet_pro 1. *RESULT Total: Total= 5041 ms 2. *RESULT Total: Total= 3692 ms 3. *RESULT Total: Total= 3514 ms BUG=319073, 326165, 326483 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=163563

Patch Set 1 : . #

Total comments: 3

Patch Set 2 : Fixup. #

Total comments: 6

Patch Set 3 : Changes from review. #

Total comments: 18

Patch Set 4 : Changes from review. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+222 lines, -81 lines) Patch
A LayoutTests/http/tests/loading/promote-img-in-viewport-priority.html View 1 chunk +23 lines, -0 lines 0 comments Download
A + LayoutTests/http/tests/loading/promote-img-in-viewport-priority-expected.txt View 2 chunks +2 lines, -0 lines 0 comments Download
D LayoutTests/http/tests/loading/promote-img-preload-priority.html View 1 chunk +0 lines, -14 lines 0 comments Download
D LayoutTests/http/tests/loading/promote-img-preload-priority-expected.txt View 1 chunk +0 lines, -12 lines 0 comments Download
A + LayoutTests/http/tests/misc/resources/image-slow-out-of-viewport.pl View 0 chunks +-1 lines, --1 lines 0 comments Download
M Source/core/core.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/fetch/ResourceFetcher.cpp View 1 chunk +3 lines, -1 line 0 comments Download
A + Source/core/fetch/ResourceLoadPriorityOptimizer.h View 1 chunk +25 lines, -26 lines 0 comments Download
A + Source/core/fetch/ResourceLoadPriorityOptimizer.cpp View 1 chunk +28 lines, -29 lines 0 comments Download
M Source/core/frame/FrameView.cpp View 4 chunks +12 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderBlock.h View 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderBlock.cpp View 1 2 3 4 chunks +70 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderImage.h View 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderImage.cpp View 1 2 chunks +36 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderObject.h View 2 chunks +3 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderObject.cpp View 1 2 3 2 chunks +13 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
shatch
https://codereview.chromium.org/109153003/diff/20001/Source/core/frame/FrameView.cpp File Source/core/frame/FrameView.cpp (right): https://codereview.chromium.org/109153003/diff/20001/Source/core/frame/FrameView.cpp#newcode1681 Source/core/frame/FrameView.cpp:1681: if (m_frame->document() && m_frame->document()->renderer()) { There was a crash ...
7 years ago (2013-12-07 03:16:15 UTC) #1
eseidel
lgtm https://codereview.chromium.org/109153003/diff/40001/Source/core/rendering/RenderBlock.cpp File Source/core/rendering/RenderBlock.cpp (right): https://codereview.chromium.org/109153003/diff/40001/Source/core/rendering/RenderBlock.cpp#newcode1278 Source/core/rendering/RenderBlock.cpp:1278: for (const FillLayer* layer = blockStyle->backgroundLayers(); layer; layer ...
7 years ago (2013-12-09 23:57:38 UTC) #2
shatch
https://codereview.chromium.org/109153003/diff/40001/Source/core/rendering/RenderBlock.cpp File Source/core/rendering/RenderBlock.cpp (right): https://codereview.chromium.org/109153003/diff/40001/Source/core/rendering/RenderBlock.cpp#newcode1278 Source/core/rendering/RenderBlock.cpp:1278: for (const FillLayer* layer = blockStyle->backgroundLayers(); layer; layer = ...
7 years ago (2013-12-10 01:41:28 UTC) #3
eseidel
lgtm. Feel free to ignore the nits. The only one of substance is possibly refactoring ...
7 years ago (2013-12-10 17:15:29 UTC) #4
eseidel
https://codereview.chromium.org/109153003/diff/60001/Source/core/rendering/RenderBlock.cpp File Source/core/rendering/RenderBlock.cpp (right): https://codereview.chromium.org/109153003/diff/60001/Source/core/rendering/RenderBlock.cpp#newcode1303 Source/core/rendering/RenderBlock.cpp:1303: if (blockStyle->listStyleImage()) On 2013/12/10 17:15:30, eseidel wrote: > You ...
7 years ago (2013-12-10 17:17:05 UTC) #5
shatch
https://codereview.chromium.org/109153003/diff/60001/Source/core/rendering/RenderBlock.cpp File Source/core/rendering/RenderBlock.cpp (right): https://codereview.chromium.org/109153003/diff/60001/Source/core/rendering/RenderBlock.cpp#newcode1286 Source/core/rendering/RenderBlock.cpp:1286: for (const FillLayer* layer = styleLayers[i]; layer; layer = ...
7 years ago (2013-12-10 18:56:19 UTC) #6
eseidel
lgtm
7 years ago (2013-12-10 19:23:54 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/simonhatch@chromium.org/109153003/80001
7 years ago (2013-12-10 19:24:24 UTC) #8
commit-bot: I haz the power
7 years ago (2013-12-10 20:24:46 UTC) #9
Message was sent while issue was closed.
Change committed as 163563

Powered by Google App Engine
This is Rietveld 408576698