Open Bug 165610 Opened 22 years ago Updated 7 years ago

low hanging perf fruit

Categories

(SeaMonkey :: MailNews: Message Display, defect)

defect
Not set
normal

Tracking

(Not tracked)

People

(Reporter: sspitzer, Assigned: neil)

Details

(Keywords: perf, Whiteboard: see comment 21, 29)

Attachments

(4 files, 5 obsolete files)

low hanging perf fruit:

1) remove sidebar from ab, hide by default in mail (existing bug)
2) startup page for mozilla, about:blank
3)

function OnLoadMessenger()                                                     
{                                                                               
  setTimeout(delayedOnLoadMessenger, 0);                                        
}                                                                               

function delayedOnLoadMessenger()                                               
{
  ...
}                                                       

4)

// skip these for now, since account central is hidden                        
// and we are selecting the inbox by default                                  
// and the start page is about:blank                                          
//HideAccountCentral();                                                       
//loadStartPage();             

      <vbox id="accountCentralBox" flex="1" collapsed="true">                   

5)

        if (window.frames["messagepane"].location != "about:blank") {           
          loadStartPage();                                                      
          gDisplayStartupPage = false;                                          
        }                       

6)

function ComposeLoad()
{
  setTimeout(DelayedComposeLoad, 0);                                            
}                                                                              

function DelayedComposeLoad()                                                   
{
...
}
Target Milestone: --- → mozilla1.3alpha
> startup page for mozilla, about:blank
> //loadStartPage();
The start page currently gets loaded twice (once if you start with Account
Central, when you can't even see the start page...), the second time by
commandglue.js, so don't fiddle with the prefs just yet. See also bug 61950.

> // skip these for now, since account central is hidden
> // and we are selecting the inbox by default
> // and the start page is about:blank
> //HideAccountCentral();
You could also remove the call to HideAccountCentral from OpenInboxForServer.

> window.frames["messagepane"].location
Um... this code doesn't exist any more...

And one more you might like: many JS scripts are loaded into arbitrary windows
and never get used - they should be limited to those windows where they are
needed. Then functions only used in 3pane should only be defined in scripts
loaded by 3pane (e.g. commandglue.js, widgetglue.js, msgMail3PaneWindow.js).

Some scripts are even loaded multiple times in the same window e.g.
messageWindow.xul loads commandglue.js twice, but never uses it?
> <vbox id="accountCentralBox" flex="1" collapsed="true">
Actually I did run up against a problem where view headers all would move the
scrollbar vertically off the screen... the only fix I could come up with was to
start up in account central view i.e. collapse everything else instead :-)
Attached patch 4 perf fixes (obsolete) — Splinter Review
System: Pentium 133Mhz 80MB Windows 98 Mozilla Build ID: 2002082908
Total window open time: ~10s, of which 3s is JS code
1. Rewrite PerformExpandForAllOpenServers saves 0.5s (5%)
2. Fix utilityOverlay.js saves 0.1s (1%)
3. Don't include cmd_delete in toolbar updates saves 0.1s (1%)
4. Pre-disable some toolbar commands saves 0.1s (1%)
You could also make the window appear 0.6s earlier by moving
SetFocusThreadPane.
Follow-up to comment #2, there's a bug filed that View/Headers/All makes the
message pane grow, the fix is to add collapsed="true" to the XUL and remove it
(unless the splitter state is collapsed) on startup (and HideAccountCentral
would do this). Unfortunately this would probably force a refliw and slow down
loading.
Here's two more perf fixes: 1. Make all the items in nsIFolderListener.idl
nsIFolders rather than nsISupports, this will save you from having to QI them
back and forth (both C++ and JS). This may apply to other listeners. 2. Don't QI
an nsIFolder to an nsIRDFResource just to get its value, that's just the .URI!
Attached patch 5 perf fixes (obsolete) — Splinter Review
Improved loadStartFolder by not creating RDF resources.

I noticed that showMailIntegrationDialog takes 2% of overall load time;
that seems alot when it doesn't actually do anything, but perhaps it (and
probably SetFocusThreadPane) could be moved to the end of loadStartFolder.
Attachment #97420 - Attachment is obsolete: true
According to Venkman,
nsDragAndDrop.js is loaded twice
nsTransferable.js is loaded twice
strres.js is loaded twice
commandglue.js is loaded twice
mail-offline.js is loaded twice
mailOverlay.xul is loaded three times?
Oh, I now see that cmd_delete is put in the toolbar update so that the delete
key works... perhaps we can only call UpdateDeleteCommand() when opening the menu.
After rereading the code I see that the mail integration dialog is on a timeout.
Unfortunately it fires before loadStartFolder so there's an ugly delay there.
Also, there's a problem with using SetFocusThreadPane in a timeout (either on
its own or via putting the whole OnLoadMessenger in a timeout) - when the
timeout fires it grabs focus from the current window which if you're impatient
or loading another focus-grabbing window such as Chatzilla results in an
annoying switch.
Attached patch More perf fixes (obsolete) — Splinter Review
Added new "virtual" <command id="menuitem_delete"> to handle updating the label
and accesskey of the menuitem so that they aren't updated on every
focus/selection change, and also fixed it so that when focus is in the quick
search or other input then the label reverts back to _D_el, this saves some
focus code in onEvent.
Used XPConnect magic to make IsCurrentLoadedFolder(item) more efficient.
Removed more load event listeners when they fire.
Attachment #97527 - Attachment is obsolete: true
note, sidebar is gone from mail and addressbook.
Status: NEW → ASSIGNED
Target Milestone: mozilla1.3alpha → mozilla1.2beta
Attached patch Another perf fix (obsolete) — Splinter Review
Found an optimization in SelectFolder
Attachment #97957 - Attachment is obsolete: true
QA Contact: olgam → stephend
Attached patch Bitrot :-(Splinter Review
Attachment #99257 - Attachment is obsolete: true
Attachment #97553 - Attachment is obsolete: true
not going to happen for 1.2 beta, sliding out.
Target Milestone: mozilla1.2beta → mozilla1.3alpha
sliding out again, so untargetting.
Target Milestone: mozilla1.3alpha → ---
OK, so some of my fixes are wrong, in particular
utilityOverlay.js should use a bubbling event listener
key_delete should not [observe] command="cmd_delete"

There may be also be some scope for minor perf by cleaning up code,
for instance using .hidden instead of etAttribute("hidden"
assigning to neil, he's got plans to tackle this.
Assignee: sspitzer → neil
Status: ASSIGNED → NEW
Keywords: perf
I am a bit at a loss which problems are tackled by this bug and which are
obsolete. Neil, can you summarize which patches you currently plan to provide?
Thank you.
Change event listener in utilityOverlay.js to bubbling instead of capturing
Change event listener in threadPane.js to bubbling instead of capturing
Make key_delete not use command="cmd_delete"
Avoid updating the whole mail toolbar when changing focus
Pre-disable the mail toolbar items that don't immediately apply in the 3-pane
Make the title of the delete menu update more efficiently
Reduce the number of calls to QueryInterface
Remove the duplicate/account central start page load
Optimize PerformExpandForAllOpenServers
Optimize loadStartFolder
OS: Windows 2000 → All
Hardware: PC → All
Neil, I can review the last two patches.
Well I'd better update them for bitrot then :-)
Some of the stuff will take some time to unbitrot, this is a start although
it's getting a bit late (here) so I haven't actually retested it yet ;-)
Interesting... the folder pane's isCommandEnabled blocks special folders (except
Junk, to work around a bug), then doCommand has special code to handle deleting
special folders...
Crawling the folder tree is quite slow while this should be snappy.
Attachment #149411 - Flags: superreview?(bienvenu)
Attachment #149411 - Flags: review?(mscott)
Attachment #149411 - Flags: superreview?(bienvenu) → superreview+
Attachment #149411 - Flags: review?(mscott) → review+
Product: Browser → Seamonkey
(In reply to comment #26)
> Created an attachment (id=149411) [details]
> Better fix for PerformExpandForAllOpenServers
> 
> Crawling the folder tree is quite slow while this should be snappy.

Neil, this checked in 2004-05-31 04:42. Is this bug fixed, or is there something left?
No. See comment 21 for the full list.
QA Contact: stephend → message-display
Whiteboard: see comment 21
Neil says over IRC:
1) is done, 2) is not, 3) is "n/a", 4) is not, 5) is done, 6) is not, 7/8) don't know, 9/10) done, I think

> Change event listener in utilityOverlay.js to bubbling instead of capturing
Done.

> Change event listener in threadPane.js to bubbling instead of capturing
Not.

> Make key_delete not use command="cmd_delete"
N/A.

> Avoid updating the whole mail toolbar when changing focus
Not.

> Pre-disable the mail toolbar items that don't immediately apply in the 3-pane
Done.

> Make the title of the delete menu update more efficiently
Not.

> Reduce the number of calls to QueryInterface
> Remove the duplicate/account central start page load
Don't know.

> Optimize PerformExpandForAllOpenServers
> Optimize loadStartFolder
Done.

So the current ToDo list is:
> Change event listener in threadPane.js to bubbling instead of capturing
> Avoid updating the whole mail toolbar when changing focus
> Make the title of the delete menu update more efficiently
> Reduce the number of calls to QueryInterface
> Remove the duplicate/account central start page load
Whiteboard: see comment 21 → see comment 21, 29
Need to update this bug, and make a similar one for Firefox and Thunderbird.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: