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

Issue 14623021: Introduce a priority queue to the image loader. (Closed)

Created:
7 years, 7 months ago by mtomasz
Modified:
7 years, 7 months ago
Reviewers:
yoshiki, James Hawkins
CC:
chromium-reviews, feature-media-reviews_chromium.org, rginda+watch_chromium.org, arv+watch_chromium.org
Visibility:
Public.

Description

Introduce a priority queue to the image loader. Image loader used to start loading all requests at once, which caused long loading times in some scenarios. Eg. while images in the mosaic view are being loaded in the background, switching to the next image in the slide view is slow. It may happen that there are hundreds of pending images (for mosaic view preload) which have to be handled before the one is important (slide view). To fix this issue (1) priorities were introduces, (2) tasks are queued, (3) number of tasks performed in parallel is limited to 5. In practice, it gives a guarantee that there will be at most 5 tasks with lower priority executed before a task with higher priority. Taking into account an average resizing time, which is around 200ms, this gives a guarantee that on average, the image with the highest priority will be handled in the worst case with 1 second of delay. Along the way, the selected images in the mosaic view have higher priority than other tiles. Also, background thumbnail generation for copying images has now very low priority to minimize load of important images. TEST=Tested manually. BUG=239237 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=201245

Patch Set 1 #

Total comments: 2

Patch Set 2 : Cleaned up. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+175 lines, -21 lines) Patch
M chrome/browser/resources/file_manager/js/file_manager.js View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/resources/file_manager/js/media/media_util.js View 4 chunks +10 lines, -4 lines 0 comments Download
M chrome/browser/resources/file_manager/js/photo/mosaic_mode.js View 2 chunks +5 lines, -1 line 0 comments Download
A + chrome/browser/resources/image_loader/OWNERS View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/resources/image_loader/client.js View 1 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/resources/image_loader/image_loader.js View 10 chunks +158 lines, -13 lines 3 comments Download

Messages

Total messages: 14 (0 generated)
mtomasz
@jhawkins: PTAL. Thanks. https://codereview.chromium.org/14623021/diff/1/chrome/browser/resources/image_loader/OWNERS File chrome/browser/resources/image_loader/OWNERS (left): https://codereview.chromium.org/14623021/diff/1/chrome/browser/resources/image_loader/OWNERS#oldcode2 chrome/browser/resources/image_loader/OWNERS:2: satorux@chromium.org I don't understand this. I've ...
7 years, 7 months ago (2013-05-10 11:14:52 UTC) #1
mtomasz
https://codereview.chromium.org/14623021/diff/1/chrome/browser/resources/image_loader/OWNERS File chrome/browser/resources/image_loader/OWNERS (left): https://codereview.chromium.org/14623021/diff/1/chrome/browser/resources/image_loader/OWNERS#oldcode2 chrome/browser/resources/image_loader/OWNERS:2: satorux@chromium.org On 2013/05/10 11:14:52, mtomasz wrote: > I don't ...
7 years, 7 months ago (2013-05-10 12:09:51 UTC) #2
mtomasz
On 2013/05/10 12:09:51, mtomasz wrote: > https://codereview.chromium.org/14623021/diff/1/chrome/browser/resources/image_loader/OWNERS > File chrome/browser/resources/image_loader/OWNERS (left): > > https://codereview.chromium.org/14623021/diff/1/chrome/browser/resources/image_loader/OWNERS#oldcode2 > ...
7 years, 7 months ago (2013-05-14 06:21:21 UTC) #3
James Hawkins
You're going to need to get a file_manager OWNER.
7 years, 7 months ago (2013-05-15 17:35:48 UTC) #4
James Hawkins
image_loader LGTM with nits. https://codereview.chromium.org/14623021/diff/2001/chrome/browser/resources/image_loader/image_loader.js File chrome/browser/resources/image_loader/image_loader.js (right): https://codereview.chromium.org/14623021/diff/2001/chrome/browser/resources/image_loader/image_loader.js#newcode261 chrome/browser/resources/image_loader/image_loader.js:261: * nit: Remove blank line. ...
7 years, 7 months ago (2013-05-15 17:37:18 UTC) #5
mtomasz
https://codereview.chromium.org/14623021/diff/2001/chrome/browser/resources/image_loader/image_loader.js File chrome/browser/resources/image_loader/image_loader.js (right): https://codereview.chromium.org/14623021/diff/2001/chrome/browser/resources/image_loader/image_loader.js#newcode261 chrome/browser/resources/image_loader/image_loader.js:261: * On 2013/05/15 17:37:18, James Hawkins wrote: > nit: ...
7 years, 7 months ago (2013-05-16 02:18:01 UTC) #6
mtomasz
@yoshiki: PTAL at the Files.app's code.
7 years, 7 months ago (2013-05-16 02:20:17 UTC) #7
yoshiki
file_manager lgtm
7 years, 7 months ago (2013-05-16 10:34:31 UTC) #8
mtomasz
On 2013/05/16 10:34:31, yoshiki wrote: > file_manager lgtm @jhawkins: Ping.
7 years, 7 months ago (2013-05-20 03:00:11 UTC) #9
mtomasz
On 2013/05/20 03:00:11, mtomasz wrote: > On 2013/05/16 10:34:31, yoshiki wrote: > > file_manager lgtm ...
7 years, 7 months ago (2013-05-21 03:09:46 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mtomasz@chromium.org/14623021/2001
7 years, 7 months ago (2013-05-21 03:10:13 UTC) #11
James Hawkins
"LGTM with nits" means you don't have to wait for me to take another look.
7 years, 7 months ago (2013-05-21 03:23:23 UTC) #12
mtomasz
On 2013/05/21 03:23:23, James Hawkins wrote: > "LGTM with nits" means you don't have to ...
7 years, 7 months ago (2013-05-21 03:28:47 UTC) #13
commit-bot: I haz the power
7 years, 7 months ago (2013-05-21 07:23:48 UTC) #14
Message was sent while issue was closed.
Change committed as 201245

Powered by Google App Engine
This is Rietveld 408576698