Closed
Bug 307615
Opened 19 years ago
Closed 19 years ago
Significantly reduce memory allocations for IMAP mail download by improving |nsIMAPGenericParser::AdvanceToNextLine()|
Categories
(MailNews Core :: Networking: IMAP, defect)
MailNews Core
Networking: IMAP
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: engel, Assigned: engel)
References
Details
(Keywords: fixed1.8.1, perf)
Attachments
(1 file)
4.89 KB,
patch
|
Bienvenu
:
review+
Bienvenu
:
superreview+
|
Details | Diff | Splinter Review |
Note that mail messages are read in line-by-line via calls to
|AdvanceToNextLine()|, see
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/mailnews/imap/src/nsImapServerResponseParser.cpp&rev=1.123&root=/cvsroot#2706
Note that in |AdvanceToNextLine()|, a |strdup| of every line is made in order to
be able to tokenize the line later. However, this copy is never needed, since
no tokenization takes place while downloading the mail message.
This means that every incoming mail line triggers an unnecessary memory
allocation (!), e.g. about 20,000 extra allocations for downloading a 1 MB
attachment. This should be avoided.
Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•19 years ago
|
||
Delay initialization of tokenizer (strdup) until either |AdvanceToNextToken| or
|AdvanceTokenizerStartingPoint| is invoked.
(Patch for Bug 307605 should be applied first.)
Assignee | ||
Updated•19 years ago
|
Attachment #195364 -
Flags: review?(bienvenu)
Assignee | ||
Comment 2•19 years ago
|
||
Note that the suggested patch does not alter the behavior of
|nsIMAPGenericParser|. Particular care is taken when empty lines are parsed
(the current behavior is somewhat non-intuitive and should probably be changed
in the future; however, this should be examined in a different bug report).
Comment 3•19 years ago
|
||
fix checked in, thanks!
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 4•19 years ago
|
||
On a one-year-old computer, while downloading a large attachment of an IMAP
message with Thunderbird (the 30MB mozilla source code is very useful for such
tests), the CPU usage is roughly 5-10% lower on todays build than it is on
1.5b2; probably due to this patch.
Comment 5•19 years ago
|
||
Comment on attachment 195364 [details] [diff] [review]
Delay initialization of tokenizer (strdup)
marking reviews.
Attachment #195364 -
Flags: superreview+
Attachment #195364 -
Flags: review?(bienvenu)
Attachment #195364 -
Flags: review+
Assignee | ||
Updated•19 years ago
|
Keywords: fixed1.8.1
Updated•16 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•