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)
SeaMonkey
MailNews: Message Display
Tracking
(Not tracked)
RESOLVED
WONTFIX
Future
People
(Reporter: sspitzer, Assigned: cavin)
References
Details
(Keywords: perf)
Attachments
(3 files, 2 obsolete files)
|
842 bytes,
patch
|
Details | Diff | Splinter Review | |
|
25.15 KB,
text/plain
|
Details | |
|
958 bytes,
text/plain
|
Details |
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.
| Reporter | ||
Comment 1•24 years ago
|
||
| Reporter | ||
Comment 2•24 years ago
|
||
| Reporter | ||
Comment 3•24 years ago
|
||
| Reporter | ||
Comment 4•24 years ago
|
||
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.
| Reporter | ||
Comment 5•24 years ago
|
||
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.
| Reporter | ||
Comment 6•24 years ago
|
||
| Reporter | ||
Comment 7•24 years ago
|
||
| Reporter | ||
Updated•24 years ago
|
Attachment #52345 -
Attachment is obsolete: true
| Reporter | ||
Updated•24 years ago
|
Attachment #52347 -
Attachment is obsolete: true
| Reporter | ||
Updated•24 years ago
|
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)
| Assignee | ||
Comment 8•24 years ago
|
||
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
Comment 9•24 years ago
|
||
moving to future based on Cavin's results which show this wouldn't save much time.
Target Milestone: --- → Future
Updated•21 years ago
|
Product: Browser → Seamonkey
Comment 10•19 years ago
|
||
wontfix based on measurements in comment 8 ?
Comment 11•18 years ago
|
||
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.
Description
•