Closed
Bug 293100
Opened 20 years ago
Closed 14 years ago
ComposeMessage logic is perf nightmare
Categories
(MailNews Core :: Composition, defect)
MailNews Core
Composition
Tracking
(Not tracked)
RESOLVED
FIXED
Thunderbird 3.3a3
People
(Reporter: timeless, Assigned: iannbugzilla)
References
()
Details
(Keywords: perf)
Attachments
(1 file, 2 obsolete files)
13.81 KB,
patch
|
iannbugzilla
:
review+
Bienvenu
:
superreview+
|
Details | Diff | Splinter Review |
(esp for forward many messages as attachments)
1. the code spends 2n-1 times concatenating elements from an array. it could use
join(",") which would make spidermonkey *much* happier.
2. the code spends n+1 times trying to find an identity. This should at least be
optimizable so that it's optimistic and only looks for an identity while it
hasn't found one.
3. it recalculates whether it wants new windows each time through this loop.
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #182754 -
Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #182754 -
Flags: review?(neil.parkwaycc.co.uk)
Comment 2•20 years ago
|
||
Please capitalize names of buttons, as they are proper nouns and it makes for
easier perusal of the code.
Comment 3•20 years ago
|
||
Comment on attachment 182754 [details] [diff] [review]
reorganize the code
>+ switch (type) {
>+ case msgComposeType.New: //new message
We indent case under switch, this should have the benefit of "fixing" the
whitespace changes (particularly as bugzilla can't convert a diff into a diff
-w).
>+ messenger.SetWindow(window, msgWindow);
Odd, I wonder what the point of that is; it gets set in the onload handler, so
it's unnecessary here. It's already been commented out of mail-offline.js too.
>+ var object = null;
Don't let me stop you from killing unused variables ;-)
>+ var useNewWin = type != msgComposeType.ForwardAsAttachment;
>+ if (!useNewWin) {
No point creating this variable for a single use. In fact I almost think this
should be a separate case "block".
>+/*
>+ type == msgComposeType.Reply || type == msgComposeType.ReplyAll || type == msgComposeType.ForwardInline ||
>+ type == msgComposeType.ReplyToGroup || type == msgComposeType.ReplyToSender ||
>+ type == msgComposeType.ReplyToSenderAndGroup ||
>+ type == msgComposeType.Template || type == msgComposeType.Draft;
>+ */
Don't see the point of this.
>+ var uri = "";
You don't use this any more, do you?
Attachment #182754 -
Flags: superreview?(neil.parkwaycc.co.uk)
Attachment #182754 -
Flags: review?(neil.parkwaycc.co.uk)
Attachment #182754 -
Flags: review-
Comment 4•19 years ago
|
||
still worth pursuing?
Comment 5•19 years ago
|
||
would fixing this bug in any way improve Bug 130010?
Comment 6•19 years ago
|
||
No, that bug is about setting the list of newsgroups after creating the window; this bug is just cleaning up some of the window creation logic.
Updated•17 years ago
|
Product: Core → MailNews Core
Updated•16 years ago
|
Whiteboard: [patchlove]
Updated•16 years ago
|
Attachment #182754 -
Attachment is obsolete: true
Comment 8•16 years ago
|
||
Comment on attachment 182754 [details] [diff] [review]
reorganize the code
Patch is obsolete - mailnews/base/resources/content/mailCommands.js file doesn't exist.
Comment 9•16 years ago
|
||
Is this bug still relevant - if so, timeless, any chance of a new patch?
Assignee | ||
Comment 10•14 years ago
|
||
Changes since last patch:
* Unbitrotted to take account of forking.
* Review comments addressed.
* Switched to using GetIdentityForHeader for SM.
Assignee: timeless → iann_bugzilla
Attachment #502009 -
Flags: review?(neil)
Comment 11•14 years ago
|
||
Comment on attachment 502009 [details] [diff] [review]
Revised patch v0.2
>+ case msgComposeType.ForwardAsAttachment:
>+ if (messageArray && messageArray.length)
...
>+ default:
Need to check messageArray != null here too?
>+ var messageUri;
>+ for (var i = 0; i < messageArray.length; ++i)
>+ {
>+ messageUri = messageArray[i];
Nit: could use var messageUri = messageArray[i];
Attachment #502009 -
Flags: review?(neil) → review+
Assignee | ||
Comment 12•14 years ago
|
||
Changes since v2.0
* Added another null check on messageArray as suggested.
* Moved var declaration into for loop as suggested.
Carrying forward r= and requesting sr= to cover off Thunderbird as well as SeaMonkey
Attachment #502009 -
Attachment is obsolete: true
Attachment #506272 -
Flags: superreview?(bienvenu)
Attachment #506272 -
Flags: review+
Updated•14 years ago
|
Attachment #506272 -
Flags: superreview?(bienvenu) → superreview+
Assignee | ||
Comment 13•14 years ago
|
||
Comment on attachment 506272 [details] [diff] [review]
Revised patch v2.1 [Checked in: Comment 13]
http://hg.mozilla.org/comm-central/rev/59dbf0a18c42
Attachment #506272 -
Attachment description: Revised patch v2.1 → Revised patch v2.1 [Checked in: Comment 13]
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Target Milestone: --- → Thunderbird 3.3a3
You need to log in
before you can comment on or make changes to this bug.
Description
•