Closed Bug 103444 Opened 24 years ago Closed 18 years ago

improve mailnews performance avoiding the frequent pref calls (and string prefs, copies and allocations)

Categories

(SeaMonkey :: MailNews: Message Display, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX
Future

People

(Reporter: sspitzer, Assigned: cavin)

References

Details

(Keywords: perf)

Attachments

(3 files, 2 obsolete files)

improve performance avoiding the frequent pref calls and string copies I'll get you a log of all the char prefs we get and copy on startup, when doing -mail.
Attached patch pref log (obsolete) — Splinter Review
I want to add non-scriptable methods GetTypeConst() instead of going through prefs (and that hashtable lookup), and allocating and copying the string, I want to fix it so we can return const ** to the type. add a nsCString (mType) to nsMsgIncomingServer. NS_IMETHODIMP nsMsgIncomingServer = GetTypeConst(const char **type) { *type = mType.get(); } we'll have to fix GetType / SetType to poke mType then, find the C++ callers of GetType and fix them to use GetTypeConst(). can't do js, since GetTypeConst() will not be scriptable. same goes for directory, redirector type, userName, hostName, anything that is showing up on the logs.
while it won't save us string allocations and string copies, we're also doing a lot of bool and int pref calling when we could cache the values in the server. here comes a new diff and a new log.
Attachment #52345 - Attachment is obsolete: true
Attachment #52347 - Attachment is obsolete: true
Keywords: perf
Summary: improve mailnews performance avoiding the frequent pref calls and string copies → improve mailnews performance avoiding the frequent pref calls (and string prefs, copies and allocations)
I did some measurement tests and from the results I don't think the prefs calls play a major role in deteriorating performance. Test Data (in milliseconds): 1. Calling GetDisplayStartupPage(&yesNo) which returns member variable value. GetDisplayStartupPage: Time needed for 1-1000 calls is 0 GetDisplayStartupPage: Time needed for 1001-2000 calls is 0 GetDisplayStartupPage: Time needed for 2001-3000 calls is 0 GetDisplayStartupPage: Time needed for 3001-4000 calls is 0 GetDisplayStartupPage: Time needed for 4001-5000 calls is 0 2. Calling GetType(getter_Copies(type)) which gets value from prefs. GetType(): Time needed for 1-1000 calls is 30 GetType(): Time needed for 1001-2000 calls 30 GetType(): Time needed for 2001-3000 calls is 30 GetType(): Time needed for 3001-4000 calls is 30 GetType(): Time needed for 4001-5000 calls is 30 Here is test code I wrote: #if 1 // Timing test PRIntervalTime startTime,currTime; nsXPIDLCString type; PRBool yesNo; int i, j, k, from, to; for (k=1; k<=2; k++) for (i=1; i<=5; i++) { to = i * 1000; from = (i-1)*1000+1; startTime = PR_IntervalNow(); for (j=from; j<=to; j++) { if (k == 1) rv = GetType(getter_Copies(type)); else rv = GetDisplayStartupPage(&yesNo); } currTime = PR_IntervalNow(); if (k == 1) printf("GetType(): Time needed for %d-%d calls is %d\n", from, to, (long)PR_IntervalToMilliseconds(currTime-startTime)); else printf("GetDisplayStartupPage: Time needed for %d-%d calls is %d\n", from, to, (long)PR_IntervalToMilliseconds(currTime-startTime)); } #endif
moving to future based on Cavin's results which show this wouldn't save much time.
Target Milestone: --- → Future
Blocks: 63759
OS: Windows 2000 → All
QA Contact: esther → stephend
Hardware: PC → All
Product: Browser → Seamonkey
wontfix based on measurements in comment 8 ?
Might as well close. New bugs are cheap and analysis from 2001 is getting very old. Plus it does seem it was no problem/solution, according to the numbers.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: