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

Issue 2828373003: Stop updating FileSelection when not changed.

Created:
3 years, 8 months ago by tetsui2
Modified:
3 years, 8 months ago
Reviewers:
hirono, fukino
CC:
chromium-reviews, oka+watch_chromium.org, rginda+watch_chromium.org, mtomasz+watch_chromium.org, yamaguchi+watch_chromium.org, fukino+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Stop updating FileSelection when not changed. When copying files, entries-changed event is fired each time file is copied. When you keep selecting the source files, it leads to O(N^2) times metadata update of selected files. For some slow storage devices such as Media Transfer Protocol connected ones, this severely slows down the entire file copy. Ideally, this could also be fixed by letting CHANGE_THROTTLED listener causing metadata update to properly use metadata cache. BUG=712121 TEST=manually tested. CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Patch Set 1 #

Total comments: 2

Patch Set 2 : Address review comments. #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -0 lines) Patch
M ui/file_manager/file_manager/foreground/js/file_selection.js View 1 1 chunk +10 lines, -0 lines 3 comments Download

Messages

Total messages: 10 (2 generated)
tetsui2
Please take a look.
3 years, 8 months ago (2017-04-21 03:46:58 UTC) #3
hirono
https://codereview.chromium.org/2828373003/diff/1/ui/file_manager/file_manager/foreground/js/file_selection.js File ui/file_manager/file_manager/foreground/js/file_selection.js (right): https://codereview.chromium.org/2828373003/diff/1/ui/file_manager/file_manager/foreground/js/file_selection.js#newcode186 ui/file_manager/file_manager/foreground/js/file_selection.js:186: if (indexes[i] !== this.selection.indexes[i] || Do we need to ...
3 years, 8 months ago (2017-04-21 04:30:40 UTC) #4
tetsui2
Thank you for reviewing. https://codereview.chromium.org/2828373003/diff/1/ui/file_manager/file_manager/foreground/js/file_selection.js File ui/file_manager/file_manager/foreground/js/file_selection.js (right): https://codereview.chromium.org/2828373003/diff/1/ui/file_manager/file_manager/foreground/js/file_selection.js#newcode186 ui/file_manager/file_manager/foreground/js/file_selection.js:186: if (indexes[i] !== this.selection.indexes[i] || ...
3 years, 8 months ago (2017-04-21 04:34:50 UTC) #5
hirono
https://codereview.chromium.org/2828373003/diff/20001/ui/file_manager/file_manager/foreground/js/file_selection.js File ui/file_manager/file_manager/foreground/js/file_selection.js (right): https://codereview.chromium.org/2828373003/diff/20001/ui/file_manager/file_manager/foreground/js/file_selection.js#newcode185 ui/file_manager/file_manager/foreground/js/file_selection.js:185: for (var i = 0; i < indexes.length && ...
3 years, 8 months ago (2017-04-21 04:55:03 UTC) #6
tetsui2
https://codereview.chromium.org/2828373003/diff/20001/ui/file_manager/file_manager/foreground/js/file_selection.js File ui/file_manager/file_manager/foreground/js/file_selection.js (right): https://codereview.chromium.org/2828373003/diff/20001/ui/file_manager/file_manager/foreground/js/file_selection.js#newcode185 ui/file_manager/file_manager/foreground/js/file_selection.js:185: for (var i = 0; i < indexes.length && ...
3 years, 8 months ago (2017-04-21 05:15:35 UTC) #7
hirono
lgtm. Thanks!
3 years, 8 months ago (2017-04-21 05:20:14 UTC) #8
hirono
Regarding this comment from fukino-san, please also get lgtm from fukino. https://bugs.chromium.org/p/chromium/issues/detail?id=712121#c4
3 years, 8 months ago (2017-04-21 05:22:41 UTC) #9
fukino
3 years, 8 months ago (2017-04-21 05:44:32 UTC) #10
Since this check has a small overhead, I'd like to keep it uncommitted until the
root cause is identified. (not lgtm)

https://codereview.chromium.org/2828373003/diff/20001/ui/file_manager/file_ma...
File ui/file_manager/file_manager/foreground/js/file_selection.js (right):

https://codereview.chromium.org/2828373003/diff/20001/ui/file_manager/file_ma...
ui/file_manager/file_manager/foreground/js/file_selection.js:186: if
(entries[i].toURL() !== this.selection.entries[i].toURL()) {
nit: Let's extract a utility function to compare two entry arrays (like
util.isSameEntries) in ui/file_manager/common/js/util.js, and use
util.isSameEntry inside it.

Powered by Google App Engine
This is Rietveld 408576698