Closed
Bug 162156
Opened 24 years ago
Closed 24 years ago
mail search (over entire server) updates folder counts one at a time
Categories
(MailNews Core :: Backend, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: sspitzer, Assigned: naving)
Details
(Keywords: perf)
Attachments
(1 file, 2 obsolete files)
|
3.14 KB,
patch
|
Bienvenu
:
superreview+
|
Details | Diff | Splinter Review |
mail search (over entire server) updates folder counts one at a time
I did a mail search (over my entire imap account), and while the search was
going, I could see the affect of us opening the folders.
as we'd open one, I'd see the total message count update in the folder pane.
it wasn't batching the updates, and that probably means we're wasting a lot of
time on notifications and on repaiting.
Updated•24 years ago
|
QA Contact: gayatri → esther
| Assignee | ||
Comment 1•24 years ago
|
||
The fix is to suppress msg count notification when we are about to begin
searching and to enable it when we are done searching a folder. If we
interruptSearch() then we should enable counts for all the folders as well
close all the db's that may have been openend during Initialize(). In
nsMsgFolder we don't need to get the db
unless we are doing batching.
| Assignee | ||
Comment 2•24 years ago
|
||
Cavin, David, Can you review the fix ? thx.
Comment 3•24 years ago
|
||
Comment on attachment 95163 [details] [diff] [review]
proposed fix
r=cavin. Need to remove this comment:
+ //m_idxRunningScope = m_scopeList.Count() so it will make us not run
another url
Attachment #95163 -
Flags: review+
Comment 4•24 years ago
|
||
what does this change have to do with this bug:
+ while (m_idxRunningScope < m_scopeList.Count())
+ {
ReleaseFolderDBRef();
- m_idxRunningScope = m_scopeList.Count(); // this'll make us not run another url
+ m_idxRunningScope++;
+ }
+ //m_idxRunningScope = m_scopeList.Count() so it will make us not run
another url
m_window->StopUrls();
}
| Assignee | ||
Comment 5•24 years ago
|
||
Nothing, but it should have been that way before because when we call
nsMsgSearchSession::Initialize() we open the dbs to get folder charset. So we
should be closing all dbs if the search is interrupted.
Comment 6•24 years ago
|
||
I don't see any code in nsMsgSearchSession::Initialize() that does that. I guess
I'll need to look into it further...
| Assignee | ||
Comment 7•24 years ago
|
||
Here is the stack trace
nsImapMailFolder::GetDBFolderInfoAndDB(nsImapMailFolder * const 0x0135c68c,
nsIDBFolderInfo * * 0x0012c428, nsIMsgDatabase * * 0x0012c420) line 1758
nsMsgDBFolder::GetCharset(nsMsgDBFolder * const 0x0135c68c, unsigned short * *
0x051604a0) line 232 + 63 bytes
nsMsgSearchAdapter::GetSearchCharsets(nsMsgSearchAdapter * const 0x03a69210,
unsigned short * * 0x03a692e0, unsigned short * * 0x03a69288) line 353
nsMsgSearchOnlineMail::ValidateTerms(nsMsgSearchOnlineMail * const 0x03a69210)
line 71
nsMsgSearchScopeTerm::InitializeAdapter(nsISupportsArray * 0x03968d98) line 1376
+ 26 bytes
nsMsgSearchSession::Initialize() line 416 + 20 bytes
nsMsgSearchSession::Search(nsMsgSearchSession * const 0x03968ce
Also if someone interrupts search we don't need to get out from there without
enabling folder counts for all folders searched.
| Assignee | ||
Comment 8•24 years ago
|
||
s/ don't need to /should not
Comment 9•24 years ago
|
||
I'm confused - shouldn't we only be disabling the folder counts for the
currently searched folder, not for all folders we're about to search? Your
comment implies that we turn off folder counts for all folders, do the search,
and then turn them back on for all folders - that does seem a bit more risky...
Comment 10•24 years ago
|
||
because if it behaves the way I thought it did (just disabling notifications
when searching a folder), then on stop, we're going to be enabling notifications
on folders that we didn't disable notifications for, which is a no no.
| Assignee | ||
Comment 11•24 years ago
|
||
we disable all, and then enable all. It is not going to affect much because
search is not going to be that long anyway.
Comment 12•24 years ago
|
||
hmm, seems like an account-wide search would take quite a while, minutes, in
fact. And if, for example, messages got filtered into a folder via biff during
the meantime, we wouldn't show the new folder counts until the whole search had
finished, right? If it's too hard to disable and enable notifications while the
search is going on, then I guess we'd have to live with that.
| Assignee | ||
Comment 13•24 years ago
|
||
we disable all at once but keep enabling them one by one as search is finished
on that folder.
Comment 14•24 years ago
|
||
was there a problem turning off the notifications in GetNextUrl and turning them
off in ::OnStopRunningUrl? I guess you'd have to worry about TimeSliceSerial
when it advances the scope. You could add a method ::FinishScope() or something
that does the ReleaseFolderDBRef(), increments the m_idxRunningScope, and
re-enables notifications, and call it from the couple places that advance the
scope. In general, it's a bad idea to disable notifications for longer than
absolutely neccesary, or before it's needed - it increase the chances for things
to go wrong.
Comment 15•24 years ago
|
||
ah, by putting it in ReleaseFolderDBRef() - seems like that method might want to
get renamed since it's doing more than just releasing the reference now.
| Assignee | ||
Comment 16•24 years ago
|
||
Attachment #95163 -
Attachment is obsolete: true
| Assignee | ||
Comment 17•24 years ago
|
||
Comment on attachment 95296 [details] [diff] [review]
patch
missed out one thing.
Attachment #95296 -
Attachment is obsolete: true
| Assignee | ||
Comment 18•24 years ago
|
||
Updated•24 years ago
|
Attachment #95298 -
Flags: superreview+
Comment 19•24 years ago
|
||
Comment on attachment 95298 [details] [diff] [review]
patch
ok, thx, sr=bienvenu - for extra credit, you could make a helper routine
::OnDoneSearchFolder() and that routine would call both ReleaseDBFolderRef()
and EnableFolderNotifications(PR_TRUE), but that's up to you.
| Assignee | ||
Comment 20•24 years ago
|
||
fixed
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
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
•