Last Comment Bug 623866 - small chunk sizes results in bad performance when saving attachments to USB-stick
: small chunk sizes results in bad performance when saving attachments to USB-s...
Status: NEW
: perf
Product: Firefox
Classification: Client Software
Component: File Handling (show other bugs)
: unspecified
: x86 Windows XP
: -- minor with 2 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
: 303268 (view as bug list)
Depends on:
Blocks: 303268
  Show dependency treegraph
 
Reported: 2011-01-07 03:20 PST by m.gedig
Modified: 2016-06-22 11:13 PDT (History)
8 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description m.gedig 2011-01-07 03:20:41 PST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.16) Gecko/20101123 SeaMonkey/2.0.11
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.16) Gecko/20101123 SeaMonkey/2.0.11

When Saving attachments out of the SeaMonkey EmailClient to an USB-stick, the client becomes unresponsive and the process is very slow (6KB/s). This does not happen when storing to the HD.

Reproducible: Always

Steps to Reproduce:
1. Receive email with attachment of noticeable size (> 1/2 MB) and mount USB-flash-memory-stick
2. Select "Save" from the attachment-context-menu
3. Wait and observe speed much lower than what the Stick is capable of and unresponsiveness of client and download manager.
Actual Results:  
It took 17 minutes to store/export/save an attachment
not touching the system it works out fine.
High CPU load at times.

Expected Results:  
storing at 8MB/s

none
Comment 1 Philip Chee 2011-01-07 04:50:14 PST
Possible duplicates and similar issues:
Bug 587724 - Mozilla becomes unresponsive during USB file transfers
Bug 303268 - Very slow "Save As" with "Web Page, Complete" option to USB drive
Bug 487375 - Severe performance issues on USB stick while deleting or receiving mail
Comment 2 m.gedig 2011-01-07 07:41:23 PST
For some reason I didn't find any good matches prior to entering, but:
Bug 303268 and Bug 587724 are similar.
The issue seems persistent.
My Thumbdrive isn't slow (reads 26MB/s) but
it is FAT32 formated
Comment 3 Matthias Versen [:Matti] 2011-01-07 11:21:19 PST
There is another report about saving over network in Firefox that I can't find at the moment. It seems that Gecko stores the files in very small chunks with hurts the performance on the network and might be the reason why some USB Sticks are slow.
Comment 4 Philip Chee 2011-01-07 20:28:16 PST
According to sid0, it's the chunk size used to stream the file/attachment out to disk/whatever.
Comment 5 m.gedig 2011-01-08 08:18:21 PST
That sounds very plausible and should not be that hard to change.
In an other related bug-report I read, that it doesn't happen with NTFS formated drives. After some trouble I was able to format the Drive using NTFS with 8KB cluster-size. The problem is gone! One might argue that this is a windows issue, but I doubt MS will do anything about it. Mozilla should make sure data is written asynchronously in chunks >4KB.
THIS SEEMS LIMITED TO FAT32
since I was unable to use exFAT under WinXP-Home I can not say anything about it.
Comment 6 Matthias Versen [:Matti] 2011-01-08 09:04:07 PST
moving to core:File handling and confirming
Comment 7 Boris Zbarsky [:bz] (Out June 25-July 6) 2011-01-09 06:35:01 PST
> Mozilla should make sure data is written asynchronously in chunks >4KB.

The relevant code in nsExternalHelperAppService.cpp is:

155 // Buffer file writes in 32kb chunks
156 #define BUFFERED_OUTPUT_SIZE (1024 * 32)

and that's exactly what we do right now.  That's _if_ this is using the exthandler code.  If it's not, then what code is it using?  Philip?
Comment 8 Philip Chee 2011-01-09 09:42:38 PST
I've asked someone in #maildev to answer this (I think we have two code paths in MailNews depending on *how* you save attachments - bleah!).
Comment 9 Wayne Mery (:wsmwk, NI for questions) 2011-11-20 07:05:50 PST
(In reply to Philip Chee from comment #8)
> I've asked someone in #maildev to answer this (I think we have two code
> paths in MailNews depending on *how* you save attachments - bleah!).

Philip, do you call the results of that conversation?

http://tinyurl.com/6m6qy6t is a revision of my query from bug 487375 comment 9
Comment 10 Philip Chee 2011-11-21 03:22:32 PST
Sorry I can't remember if there was any reply to my query.
Comment 11 Wayne Mery (:wsmwk, NI for questions) 2012-03-16 04:16:39 PDT
*** Bug 303268 has been marked as a duplicate of this bug. ***
Comment 12 ISHIKAWA, Chiaki 2015-12-07 08:15:26 PST
(In reply to Wayne Mery (:wsmwk, use Needinfo for questions) from comment #9)
> (In reply to Philip Chee from comment #8)
> > I've asked someone in #maildev to answer this (I think we have two code
> > paths in MailNews depending on *how* you save attachments - bleah!).
> 
> Philip, do you call the results of that conversation?
> 
> http://tinyurl.com/6m6qy6t is a revision of my query from bug 487375 comment
> 9

This is an old news.

If you click on the attachment icon, it invokes one code path.
If you click on "Save" button in the right hand side at the bottom of message window,
then it invokes ANOTHER code path.

I think the one that is invoked by clicking the icon has a reasonable buffer size now, but I have not checked lately.

Note You need to log in before you can comment on or make changes to this bug.