Discussion:
Issue 578923 in chromium: Copying of files from Downloads to an SD card is slow
(too old to reply)
c***@googlecode.com
2016-01-19 01:26:54 UTC
Permalink
Status: Assigned
Owner: ***@chromium.org
Labels: Type-Bug Cr-Platform-Apps-FileManager Pri-2 OS-Chrome Performance

New issue 578923 by ***@google.com: Copying of files from Downloads to
an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

Google Chrome 47.0.2526.110 (Official Build) (64-bit)
Platform 7520.67.0 (Official Build) stable-channel cyan


What steps will reproduce the problem?
1. Select ~800 files of JPEG files (1.6GB in total)
2. Press Ctrl-C
3. Move to a folder in a SD card and press Ctrl-V

What is the expected output?

Files are copied quickly

What do you see instead?

Files are copied slowly

How frequently does this problem reproduce? (Always, sometimes, hard to
reproduce?)

Always. I checked the time it needed to copy ~800 files (1.6GB in total).
It took 253 secs. It's about 6MB per sec. Seems to slow.

I'll switch to the developer mode, and copy the same files with 'cp'
command on the device for comparison.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-19 01:47:17 UTC
Permalink
Updates:
Labels: -Pri-2 Pri-1

Comment #2 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

Turned out it's extremely slow if I copy a directory instead:

1. Select a directory that contains ~800 files of JPEG files (1.6GB in
total)
2. Press Ctrl-C
3. Move to a folder in a SD card and press Ctrl-V

It already took ~10 mins but the progress bar is still about 50%...
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-19 02:12:52 UTC
Permalink
Updates:
Status: Started

Comment #3 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

(No comment was entered for this change.)
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-19 02:27:15 UTC
Permalink
Updates:
Cc: ***@chromium.org

Comment #4 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

It took 27 minutes to end. mtomasz@ suspected it could be an issue with
this particular SD card. I'll test this again with another one.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-19 04:21:47 UTC
Permalink
Comment #5 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

Just tested this with a USB flash memory stick.

Copying the files - 217 secs (~7MB per sec)
Copying a directory that contains the same files - 11 minutes (2.3MB per
sec)

The directory copying was again significantly slower, though it's better
than the SD card. What's happening?
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-19 04:28:10 UTC
Permalink
Comment #7 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

I confirmed that copying 1000 photos from Downloads to SD took 20 minutes.
(on Snow)
Let me take a look.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-19 04:29:11 UTC
Permalink
Comment #8 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

#7: was it copying of 1000 files or copying of a directory that contains
1000 files?
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-19 04:31:32 UTC
Permalink
Comment #9 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

Copying a directory. Copying 1000 files is ongoing, and it looks a bit
faster than the directory copy.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-19 04:44:18 UTC
Permalink
Comment #10 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

Slowing down..., and it looks copying 1000 files is not faster than copying
a directory which contains 1000 files on Snow with ToT build.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-19 05:05:07 UTC
Permalink
Comment #11 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

I tested the SD card mentioned in #1, it the card looks slow.
On MBP, copying 300 photos (2.4GB total) to the SD took 447 seconds (5-6
MB/s).
The issue is not device specific.

The difference between directory copy and multiple file copy is still
weird, though.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-19 05:36:39 UTC
Permalink
Comment #12 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

I switched to the developer mode and ran this experiment again with the USB
flash memory stick I used in #5:

1) Copying the files - 5:16 (~5MB per sec)
2) Copying a directory that contains the same files - 11:38 (2.3MB per sec)

For whatever reason, 1) was slower than #5, but again, the directory
copying was slower.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-19 05:52:07 UTC
Permalink
Comment #13 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

I also copied the files by 'cp' command from Downloads to the the USB flash
memory stick I used in #5,:

% time cp Downloads/foo/* /media/removable/UNTITLED/tmp
real 2m52.534s <= 9.3MB per sec
...

% rm -rf /media/removable/UNTITLED/tmp
% time cp -r Downloads/foo /media/removable/UNTITLED/tmp
real 3m6.310s <= 8.6MB per sec
...

The directory copy was slightly slower, but I guess it's a noise...
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-19 06:03:38 UTC
Permalink
Comment #14 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

Copying to removable disks via File API does explicit fdatasync() while
IIUC cp command doesn't.
That may cause difference. Though I have totally no idea on directory
copying slowness.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-19 07:00:48 UTC
Permalink
Comment #15 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

FWIW, I tested with 'cp' with the original SD card I used in #1 and it took
2:28 (10.8MB per sec)
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-19 09:50:43 UTC
Permalink
Comment #16 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

This is reproducible on M44...
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-20 07:37:55 UTC
Permalink
Updates:
Cc: ***@chromium.org

Comment #17 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

It seems parallel copy causes this performance drop.
Right now, a directory copy copies up to 5 files in parallel.
https://code.google.com/p/chromium/codesearch#chromium/src/storage/browser/fileapi/recursive_operation_delegate.cc&l=19

I measured how long it takes to copy a directory which contains 100 photos
(2.4GB in total) on ToT Pixel to compare performance between parallel copy
and sequential copy.

kMaxInflightOperations=1 kMaxInflightOperations=5
Downloads to Downloads 18 sec 15 sec
USB memory to Downloads 34 sec 29 sec
Downloads to USB memory 65 sec 312 sec
Downloads to SD card A 91 sec 365 sec
Downloads to SD card B 99 sec 660 sec

Parallel copy improves performance of local copy, but there are huge
performance drops when copying to external devices.
I think disabling parallel copy when copying to external devices is an
option to fix this issue.

+kinuko@ san,
Do you know how the parallelism(5) is determined?
Are there any concerns about disabling parallel copy?
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-20 07:50:55 UTC
Permalink
Comment #18 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

Oops, "100 photos (2.4GB in total)" was wrong. It should have been "100
photos (800MB in total)".
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-20 08:11:01 UTC
Permalink
Comment #19 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

The magic number '5' is almost arbitrarily chosen (just to have some
parallelism but not to post too many tasks), I don't think we'll have any
problems by disabling it.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-20 10:33:15 UTC
Permalink
Comment #20 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

Thank you!

I'm thinking of following two ways to fix this.
(1) Disable parallel copy only when copying to external devices.
(2) Disable parallel copy at all (for simplicity).

To consider which way to go, I'll check how consistent the parallel copy
improves local copy.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-21 11:21:22 UTC
Permalink
Comment #23 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

I did a similar experiment to measure copy performance of small files.
I copied 10,000 random 3KB files.

kMaxInflightOperations=1 kMaxInflightOperations=5
Downloads to Downloads 18.5 sec 16.8 sec
Downloads to USB memory 525 sec 338 sec
Downloads to SD card A 357 sec 322 sec

The behavior was different from c#17.
Parallel copy improves the performance, even when copying to external
devices.

Hmm... It seems difficult to choose the strategy. It depends on file size,
too.
However, sequential copy for external devices still looks safer to me.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-22 06:27:35 UTC
Permalink
Comment #24 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

Let me go with option (2) in c#20 (Always copy files sequentially).

c#23 should be an extreme case. When copying a directory takes some time,
each file size should be bigger than the assumption of c#23.
Sequential copy for external devices will be much better in most cases.

Parallel copy for local copy have some improvements, but it doesn't look so
big.
As changing parallelism based on the src/dest type adds some complexity,
I'd like to use sequential copy consistently.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-26 06:16:21 UTC
Permalink
Comment #25 on issue 578923 by ***@chromium.org: Copying of files
from Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923#c25

The following revision refers to this bug:

https://chromium.googlesource.com/chromium/src.git/+/141a612f9d12ff9e5194dbba6d81d9d812f8ea7d

commit 141a612f9d12ff9e5194dbba6d81d9d812f8ea7d
Author: fukino <***@chromium.org>
Date: Tue Jan 26 06:14:49 2016

Run recursive file operations sequentially.

Parallel copy can have huge performance drop in some cases. (See issue
578923 for the detail)
For safety and simplicity, this CL makes the recursive file operations
sequential.

BUG=578923
TEST=manually confirm the performance of copying a directory to a SD card.

Review URL: https://codereview.chromium.org/1619733004

Cr-Commit-Position: refs/heads/master@{#371467}

[modify]
http://crrev.com/141a612f9d12ff9e5194dbba6d81d9d812f8ea7d/content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc
[modify]
http://crrev.com/141a612f9d12ff9e5194dbba6d81d9d812f8ea7d/storage/browser/fileapi/recursive_operation_delegate.cc
[modify]
http://crrev.com/141a612f9d12ff9e5194dbba6d81d9d812f8ea7d/storage/browser/fileapi/recursive_operation_delegate.h
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
c***@googlecode.com
2016-01-26 06:55:14 UTC
Permalink
Updates:
Status: Fixed

Comment #26 on issue 578923 by ***@chromium.org: Copying of files from
Downloads to an SD card is slow
https://code.google.com/p/chromium/issues/detail?id=578923

(No comment was entered for this change.)
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/a/chromium.org/group/chromium-bugs

---
You received this message because you are subscribed to the Google Groups "Chromium-bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-bugs+***@chromium.org.
Loading...