Closed
Bug 72899
Opened 23 years ago
Closed 16 years ago
fix GetHasSubFolders() and fix nsMsgFolderDataSource::createFolderChildNode to use it
Categories
(MailNews Core :: Database, defect)
MailNews Core
Database
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: sspitzer, Assigned: Bienvenu)
References
Details
(Keywords: perf)
we only want the first child, we can speed this up.
Reporter | ||
Comment 1•23 years ago
|
||
to fix this, I think we want to rewrite createFolderChildNode() to call the existing GetHasSubFolders() (which is part of the nsIFolder interface) but it may not be that simple. currently, to determine if we have subfolders in createFolderChildNode(), we call GetSubFolders() In the case of news (and probably imap, and local) GetSubFolders() is overriden to discover the subfolders if not initialized. if we call GetHasSubFolders() directly (which is not overriden) will just return the count of mSubFolders, but will not initalize it. now GetHasSubFolders() is scarying me. querying for "hassubfolders" in lxr, it is called in a few places. we should probably override it (just like we override GetSubFolders()). for news (and in most cases), GetHasSubFolder() would be overriden like this: if (!mInitialized) { // call GetSubFolders() to initialize mSubFolders } // now set the return result, based on the count of mSubFolders if we do that, then we could fix createFolderChildNode() comments?
Status: NEW → ASSIGNED
Summary: nsMsgFolderDataSource::createFolderChildNode, don't do GetSubFolders() → fix GetHasSubFolders() and fix nsMsgFolderDataSource::createFolderChildNode to use it
Reporter | ||
Comment 2•23 years ago
|
||
talking to bienvenu, we need nsMsgFolder::GetHasSubFolders() to call GetSubFolders(). we need to do this, otherwise mSubFolders might not be properly initialized. (GetSubFolders() will initialize if it needs to.) fixing nsMsgFolderDataSource::createFolderChildNode() to call GetHasSubFolders() will be prettier, but it will do what it does now, and call GetSubFolders().
Comment 3•23 years ago
|
||
But still, isn't it inefficent to get a whole array just to use the first element?
QA Contact: esther → stephend
Would this be a big performance win? Cavin, might this be something you and Seth have already investigated?
Hardware: PC → All
Updated•20 years ago
|
Product: MailNews → Core
Comment 5•17 years ago
|
||
sorry for the spam. making bugzilla reflect reality as I'm not working on these bugs. filter on FOOBARCHEESE to remove these in bulk.
Assignee: sspitzer → nobody
Status: ASSIGNED → NEW
Updated•16 years ago
|
QA Contact: stephend → database
Updated•16 years ago
|
Assignee: nobody → bienvenu
Assignee | ||
Comment 6•16 years ago
|
||
this is now fixed because GetHasSubfolders creates an enumerator and checks if the enumerator has any elements.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•