Tracking Message Compose Performance

by Jean-Francois Ducarroz <ducarroz@netscape.com>
last modified March 5th, 2001 14:43


In order to be able to measure where we spend our time when creating a new message compose window or when replying to a message, I have added logging information to both the tip build and the mailnews performance branch build. With this loggin, you will be able to gather information on all platforms and on a variety of machines. Also you can track progress or degradation between builds or between the tip and the performance branch.

I have split the process of creating a new message (or doing a reply/reply all) in the following steps:


The log generated by a tip build and a branch build differs slightly due to an architecture change but you are still able to compare the total time and the time for every step even if they are not occurring in the same order.

Here is a sample log:

0[a3deb0c]:
--------------------
0[a3deb0c]: [ 0][ 0] - Start opening the window, message size = 22518
0[a3deb0c]: [ 1515][ 1515] - Start Initializing the compose window (ComposeLoad)
0[a3deb0c]: [ 2364][ 849] - Done with the initialization (ComposeLoad). Waiting on editor to load about::blank
0[a3deb0c]: [ 2618][ 254] - Editor is done loading about::blank. Now let mime do its job
0[a3deb0c]: [ 3509][ 891] - done with mime. Time to insert the body
0[a3deb0c]: [ 3852][ 343] - Finished inserting data into the editor. The window is almost ready!
0[a3deb0c]: [ 4644][ 792] - addressing widget, windows title and focus are now set. The window is finally ready

How to create a Message Compose Performance Log: (adaptation of original document written by Lisa Chiang)

For all platforms, you'll need to edit your prefs.js file in your user directory (make sure you do this when Mozilla isn't running):

Add this line in:

user_pref("mailnews.logComposePerformance", true);

Then, follow these instructions for each platform:

Windows 95/98: Create "c:\tmp" for the log file to reside in if the directory does not exist. Insert the following lines into your autoexec.bat file:
Set NSPR_LOG_MODULES=msgcompose:5
Set NSPR_LOG_FILE=c:\tmp\[filename]

The filename can be defined by you. Reboot.

WinNT: Use the Control Panel | System | Environment tool to set the PRLOG env variables.
Variables: NSPR_LOG_MODULES Value: msgcompose:5
Variables: NSPR_LOG_FILE Value: c:\tmp\[filename]

Follow the remaining steps for Windows 95/98 above.

Mac: Create a text file that contains the desired commands in a text editor such as BBEdit:
ARGS: -mail
ENV:NSPR_LOG_MODULES=msgcompose:5
ENV:NSPR_LOG_FILE=[filename]

The filename can be defined by you. Save this file and drag and drop this file on the Netscape/Mozilla application icon. The log file is created in the seamonkey folder.

Unix (e.g., for csh shells): Add the following lines to ~/.cshrc file of the csh shell:
setenv NSPR_LOG_MODULES msgcompose:5
setenv NSPR_LOG_FILE /u/[unix userlogin]/tmp/[filename]

The filename can be defined by you.

The 5 in the first variable above specifies the level of logging you want - the lower the number the less logging happens. (Temporarily, though, until further notice, it's going to use PR_LOG_ALWAYS.)

The numbers are supposed to have the following meaning:

PR_LOG_NONE = 0, /* nothing */
PR_LOG_ALWAYS = 1, /* always printed */
PR_LOG_ERROR = 2, /* error messages */
PR_LOG_WARNING = 3, /* warning messages */
PR_LOG_DEBUG = 4, /* debug messages */

On all platforms, the log is written over every time you re-launch the mail application.