Open Bug 563677 Opened 14 years ago Updated 4 years ago

HTML Mail View very slow (45++ sec) for pop and local folders - speed up FolderUriForPath first lookup when switching folders

Categories

(MailNews Core :: Backend, defect)

1.9.1 Branch
x86
All
defect
Not set
major

Tracking

(blocking-thunderbird5.0 -, thunderbird5.0 wanted)

Tracking Status
blocking-thunderbird5.0 --- -
thunderbird5.0 --- wanted

People

(Reporter: Bienvenu, Unassigned)

References

(Blocks 2 open bugs, Regression)

Details

(Keywords: perf, regression, Whiteboard: [needs profile][testcase: bug 536873 comment 4][testcase: bug 1512974][analysis: bug 536873 comment 30])

+++ This bug was initially created as a clone of  +++

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1

Some HTML Mail freezes Thunderbird for a while.
Mostly in large email folders but not necessarily a large email.
Emails came from Lotus-Notes-Client and contains only few text and some spacer GIF for layout.

Effect also occurs in '-safe-mode' of Thunderbird.
No anti-virus programm is activ.
Yes, Profile is in network folder but this is probably not the reason.
Text-View of same email is OK.
Only HTML view appears as problem.

CPU-use graph in Windows-Task-Manager shows very high peaks for a while.


Reproducible: Always

Steps to Reproduce:
1. create a larger Emailfolder (about 200 plus xx)
2. ask to get HTML-mails from different Lotus Notes User
3. Open Task-Manager for CPU-use
5. switch preview of emails and notice what happens

Actual Results:  
Email is not shown for a while. 
Can't change to another mail or function.

Expected Results:  
show the email content in preview window.
David, same problem as Bug 545126, isn't it?

(Time to take display an HTML mail) == A * B * C,
 where;
  A : Number of <img src="cid:..."> in an HTML mail
  B : Number of local mail folders before folder in which the HTML mail is kept
  C : Time to acquire directory information of a mail folder file

(Case-1) Original problem on bug opener of Bug 545126
  A: Large(Lotus Notes mail), B: Large, C: Large(remote profile, CSC of Win)
(Case-2) Minimized test case by bug opener of Bug 545126
  A: Small(reduced to 7), B: Large(same as Case-1), C: Large(same as Case-1)
(Case-3) My test with 10,000 local mail folders with test mail I attached
  A: Small(4 or 40), B: Very Large(10,000), C: Small(local profile, no CSC)
(Case-4) Bug 536873 (DUP'ed to Bug 545126)
  A: Medium, B: Larger than Case-1/Case-2, C: Small(local profile, no CSC)
(Case-5) This bug
  A: Large or Very Large (Lotus Notes mail),
  B: Medium to Large (200?),
  C: Not Small (remote profile, CSC?)

Is cached result(by change to "caching the most recent result", Bug 545126) lost if very many <img> exist(Case-5)?
Caching doesn't work well if special mail structure(not-well-formed structure, funny nesting of multipart)?
Or caching doesn't work well if wrong Content-Type?
(application/octet-stream for image data part with Content-ID:)
WADA, I cloned bug 545126 so that we could do a non-caching fix, using sid's patch as a starting point. Caching doesn't help the first lookup, but subsequent lookups should be fast. This bug is about fixing the first lookup.
(In reply to comment #2)
> WADA, I cloned bug 545126 so that we could do a non-caching fix, using sid's
> patch as a starting point. Caching doesn't help the first lookup, but
> subsequent lookups should be fast. This bug is about fixing the first lookup.

bienvenu, standard8, is this bug still wanted, since the 3.0->3.1 major update has flown the coop?
yes, if I remember, sid had some ideas about how to make the first lookup faster using a hash table that we keep up to date.
Assignee: bienvenu → sid.bugzilla
If someone sees slow message display on first view, but second and subsequent views are fast, then then there's a good chance they are seeing this bug?


sid, possible for you to revisit this soon?
I have a similar problem which may be related to Wada's Point B above.
B : Number of local mail folders before folder in which the HTML mail is kept
It shows itself with simple folder selection (a newsgroup about 150 folders deep)
Can take up to 30 seconds to select and show the threadpane.
Heavy disc I/O during that delay.
New bug..or related.
(In reply to comment #5)
> If someone sees slow message display on first view, but second and subsequent
> views are fast, then then there's a good chance they are seeing this bug?
Yes, on a per-folder basis, iirc.  The first lookup from the first message loaded in a folder is slow; subsequent lookups on that message (i.e., the message triggers multiple path lookups), and lookups from other messages in that same folder should be fast, until you click on an other message in an other folder that does an other lookup, changing the cached lookup.
ah, as described by http://getsatisfaction.com/mozilla_messaging/topics/slower_performace#reply_4890042 for example

that's pretty severe. 

No workaround? Like keeping each affected folder open in a tab?
blocking-thunderbird5.0: --- → ?
(In reply to comment #8)
> ah, as described by
> http://getsatisfaction.com/mozilla_messaging/topics/slower_performace#reply_4890042
> for example
> 
> that's pretty severe. 
> 
> No workaround? Like keeping each affected folder open in a tab?

Yes, keeping the affected folder open in a tab fixes the problem for me.
However, it adds a problem. The msf files are loaded into memory. For system with limited memory (large folders) this is can be problematic.

Example:
1 tab open TB=86,280
4 tabs     TB=302,800

On a 512 meg box, you won't be doing much else with this workaround.
this should block - or at least get focus via "needs" - there are people leaving version 3 for version 2, etc because of this bug.
I don't think we can block 3.3 on this, mainly as we haven't got anyone to work on it and we don't have long before we branch - though it is definitely wanted (also, whilst I realise some users are affected, I'm not sure that it is significant enough that this is a stop-ship).
blocking-thunderbird5.0: ? → -
Flags: wanted-thunderbird+
Keywords: helpwanted
there are a few more reports of this on gsfn
Summary: HTML Mail View very slow (45++ sec) for pop and local folders - speed up FolderUriForPath → HTML Mail View very slow (45++ sec) for pop and local folders - speed up FolderUriForPath first lookup when switching folders
Whiteboard: [gs][ref comment 4, bug 536873]
(In reply to David :Bienvenu from comment #4)
> yes, if I remember, sid had some ideas about how to make the first lookup
> faster using a hash table that we keep up to date.

Is it not time to dust this off?

I don't have time ATM to benchmark the current state of slowness, but I have to think that users are still seeing this.
Flags: needinfo?
Removing myslef on all the bugs I'm cced on. Please NI me if you need something on MailNews Core bugs from me.
Flags: needinfo? → needinfo?(mozilla)
Flags: needinfo?(mozilla) → needinfo?(vseerror)
(In reply to Joe Sabash [:JoeS1] from comment #6)
> I have a similar problem which may be related to Wada's Point B above.
> B : Number of local mail folders before folder in which the HTML mail is kept
> It shows itself with simple folder selection (a newsgroup about 150 folders
> deep)
> Can take up to 30 seconds to select and show the threadpane.
> Heavy disc I/O during that delay.
> New bug..or related.

Joe, can you profile using  https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging/Thunderbird ?

possible report http://forums.mozillazine.org/viewtopic.php?f=39&t=2345081&p=11618255#p11618255
Flags: needinfo?(vseerror) → needinfo?(jsabash)
(In reply to Wayne Mery (:wsmwk, NI for questions) from comment #15)
> (In reply to Joe Sabash [:JoeS1] from comment #6)
> > I have a similar problem which may be related to Wada's Point B above.
> > B : Number of local mail folders before folder in which the HTML mail is kept
> > It shows itself with simple folder selection (a newsgroup about 150 folders
> > deep)
> > Can take up to 30 seconds to select and show the threadpane.
> > Heavy disc I/O during that delay.
> > New bug..or related.
> 
> Joe, can you profile using 
> https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging/Thunderbird ?
> 
> possible report
> http://forums.mozillazine.org/viewtopic.
> php?f=39&t=2345081&p=11618255#p11618255

Well, I am no longer reproducing the effects of this bug on any of my PC's with Trunk or any currently tested versions. Folder selection is less that a second for me.
Flags: needinfo?(jsabash)

The folder lookup also changed in some aspects (like the RDF removal) since this bug was filed.
If we aren't getting any more more reports of this in the last years I suggest we could close it WFM.

Mike, are you still able to reproduce this?

No longer blocks: 497680
Flags: needinfo?(webmaster)
Keywords: helpwanted
Regressed by: 497680
Whiteboard: [gs][ref comment 4, bug 536873] → [gs][testcase: bug 536873 comment 4][analysis: bug 536873 comment 30]
Blocks: 1512974

Still occurs, at least the testcase in bug 1512974.

It would be good for someone to get a profile using https://github.com/thunderbird-conversations/thunderbird-conversations/wiki/Profiling-Conversation's-Performance against a reduced testcase would be good to have.

Flags: needinfo?(webmaster)
OS: Windows XP → All
Whiteboard: [gs][testcase: bug 536873 comment 4][analysis: bug 536873 comment 30] → [gs][testcase: bug 536873 comment 4][testcase: bug 1512974][analysis: bug 536873 comment 30]
Assignee: rain → nobody
Whiteboard: [gs][testcase: bug 536873 comment 4][testcase: bug 1512974][analysis: bug 536873 comment 30] → [needs profile][testcase: bug 536873 comment 4][testcase: bug 1512974][analysis: bug 536873 comment 30]
See Also: → 548413
You need to log in before you can comment on or make changes to this bug.