Closed
Bug 73395
Opened 25 years ago
Closed 25 years ago
Implement GetFirstSubFolder() in all sub-classes of nsFolder
Categories
(MailNews Core :: Backend, defect)
MailNews Core
Backend
Tracking
(Not tracked)
VERIFIED
WONTFIX
People
(Reporter: hwaara, Assigned: hwaara)
References
Details
(Keywords: perf)
Attachments
(2 files)
|
1.38 KB,
patch
|
Details | Diff | Splinter Review | |
|
1.39 KB,
patch
|
Details | Diff | Splinter Review |
When I looked at bug 72899 I realized that we need a GetFirstSubFolder().
The reason for this is that I've seen several places in the code where you call
GetSubFolders() and then just use/get the first element. GetSubFolders() is
quite memory-intensive, so using a GetFirstSubFolder() instead of
GetSubFodlers() would be a performance boost (I don't know how big though) and
would surely optimize some of the mailnews code.
I think we should implement it in all of the sub-classes of nsFolder, since
nsIFolder.idl has a GetSubFolder(). Should we also implement it in nsIFolder?
This is (very roughly, and maybe also buggy) what I've thought it should look like.
nsresult GetFirstSubFolder(nsIEnumerator** firstFolder)
{
if(!mSubFolder)
GetSubFolders(&mSubFolder);
*firstFolder = mSubFolder->ElementAt(0);
return NS_OK;
}
Something like that.. Please give comments/feedback on the best way to do this.
| Assignee | ||
Updated•25 years ago
|
| Assignee | ||
Comment 1•25 years ago
|
||
Here comes a patch that implements this for nsMsgFolder. I think everything is
done *except* that I haven't put it in any .idl file yet.
I'm uncertain where (and how!) I should put it. In nsIFolder or each sub-class'
.idl file?
| Assignee | ||
Comment 2•25 years ago
|
||
| Assignee | ||
Comment 3•25 years ago
|
||
Comment 4•25 years ago
|
||
this bug is laboring under a misconception - creating an enumerator is not
memory intensive operation - it allocates a small single chunk of memory, and
that's about it. Plus, I don't see many places where we do this at all - just
one, in fact, and that place is just trying to find out if there are subfolders,
not what the first sub-folder is.
| Assignee | ||
Comment 5•25 years ago
|
||
Bienvenu, does this mean that you think that it is unnecessary to implement this
API? Should we mark it WONTFIX?
I would also want to hear Seth's voice on this.
Comment 6•25 years ago
|
||
bienvenu is right. don't add GetFirstSubFolder, we don't need it.
see my comments in #72899 for what I think we do need.
hwaara, you should mark this wontfix.
| Assignee | ||
Comment 7•25 years ago
|
||
I will instead get my hands dirty on bug 72899.
Please VERIFY.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → WONTFIX
Target Milestone: mozilla1.0 → ---
Updated•21 years ago
|
Product: MailNews → Core
Updated•18 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•