Closed Bug 1649103 Opened 4 years ago Closed 2 years ago

[meta] (Richard) Slow performance of Thunderbird 78.x at startup. Not antivirus related.

Categories

(Thunderbird :: General, defect)

x86_64
Windows 10
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: richard.leger, Unassigned)

References

(Depends on 2 open bugs, Blocks 1 open bug)

Details

(Keywords: meta, perf, Whiteboard: [closeme 2022-10-01])

Attachments

(4 files)

This bug is opened as follow up from Bug 1642292 Comment 51

"...
Slow general startup of TB
With all calendars disabled and IMAP/SMTP account setup (no cache), TB 78.0b3 (64-bit) is currently not starting up at the speed of light:

2 sec to get prompt for choosing profile
20 sec after selecting profile to start TB and get the main UI up
35 sec to be able to read first IMAP email (no cache set) - as soon as main UI is visible I can click on message in the list but content is not immediately loaded in preview pane. It takes this extra 35s for message content to load...
= **57 sec** waiting in total from Start to Read 1st email!

..."

Keywords: perf

Find attached TB 78.0b3 startup performance with a blank profile (no email or calendar account setup)...

Also available here: https://share.firefox.dev/3dDyJ01

Steps to reproduce:

Possible culprit:

MessageLoop::Run
xul.dll
This selected call node
Running Time:
22,177ms (76%)

Re-run same process with my user profile (IMAP/SMTP mailbox enabled/online - All calendars disabled), here is the performance report gathered (from start till 1st email read/loaded in preview pane):
https://share.firefox.dev/3i8rnFz

Possible culprit:

nsThread::ProcessNextEvent
xul.dll
This selected call node
Running Time:
60,286ms (82%)
Self Time:
27ms (0%)

Wanted to chime in here with my experience after moving from TB 78.0b3 to TB 78.0b4. I did this test on my office PC using the stopwatch feature on my Android phone. My office PC is an old Latitude E6510 with Intel i5 M560, 8GB DDR3 RAM and Crucial MX300 275GB SSD. Connecting to 3 IMAP accounts, 1 NNTP server and 2 CalDAV calendars. Perfect candidate to detect if things got slower in terms of startup.

Average of three warm starts with TB x64 78.0b3: 35.91 secs
Average of three warm starts with TB x64 78.0b4: 29.03 secs

For me, startup improved between b3 and b4. But it is far slower than what I used to see when I was on TB 71.0b4 and Provider for Google Calendar.

Also noting that as of 8:30CST, b4 is not officially released on the normal beta site. I assumed the risk by getting it from it's unofficial location.

At what point did you stopped the timer?

Have you waited to click on one of the email msg and waited for content to load in preview pane?

Also make sure you don't use offline support for calendars and emails...

Like you I did noticed previous version of TB (sorry don't recall exact version I last measured prior 78.x branch) was starting faster...

(In reply to Richard Leger from comment #5)

At what point did you stopped the timer?

Have you waited to click on one of the email msg and waited for content to load in preview pane?

In my case, I already have the 1st email highlighted in my Inbox. So on TB startup, it already loads for me without intervention or clicking it.

Also make sure you don't use offline support for calendars and emails...

Like you I did noticed previous version of TB (sorry don't recall exact version I last measured prior 78.x branch) was starting faster...

I stop my timer once I see no more activity in the status bar below. If I were to stop my timer once my calendar and 1st message in Inbox loads, it would certainly be a lot less time. I am considering TB loaded once the stuff in Status Bar settles.

I did have my calendars set to Offline mode. When I uncheck Offline mode and restart TB, from launch to when activity in the status bar is done it is now done in under 20 seconds. So, faster it would seem. But, calendar loading takes an additional 22 seconds or so to finish populating my Today Pane. So about 44 seconds in total when using Offline mode. Way slower than having Offline mode enabled.

That's no good for me so I am turning back on Offline mode.

Depends on: 1652279

Richard,
Please check this candidate build this weekend and tell us if the situation improves.
https://archive.mozilla.org/pub/thunderbird/candidates/79.0b3-candidates/build1/

Flags: needinfo?(richard.leger)

(In reply to Wayne Mery (:wsmwk) from comment #7)

Richard,
Please check this candidate build this weekend and tell us if the situation improves.
https://archive.mozilla.org/pub/thunderbird/candidates/79.0b3-candidates/build1/

With https://archive.mozilla.org/pub/thunderbird/candidates/79.0b3-candidates/build1/win64/en-GB/thunderbird-79.0b3.zip
...on 4G internet connection with 100ms-130ms latency...

3 sec to get prompt for profile
18s after selecting profile to start TB and get the main UI up
1m13s to be able to read first IMAP email
= 1m35s total

I will try again later on a better connection... if I can get a better one...

Flags: needinfo?(richard.leger)

I re-run test on landline :-)
Conn Latency toward server: Minimum = 36ms, Maximum = 131ms, Average = 38ms

3 sec to get prompt for profile
25s after selecting profile to start TB and get the main UI up
1m42s to be able to read first IMAP email <-- during this time it is mostly "Looking for Folders" and towards the end "Searching for Folders" according to the status bar...
= 2m10s total

Not sure to understand why with TB thunderbird-79.0b3 build1 and a better connection I get worth results... :-(

FYI, I restarted my computer, and with TB only running... I get the similar results...

2s to get prompt for profile
25s after selecting profile to start TB and get the main UI up
58s to be able to read first IMAP email
= 1m25 total

Latency to server: Minimum = 36ms, Maximum = 39ms, Average = 37ms

I have uploaded a performance profile hoping it may help identify the issue:
https://share.firefox.dev/39AMPPA
From TB startup till first email content appearing...

FYI, disabling Windows Defender Antivirus and Firewall on Windows 10 does not make much of a difference...

2.4s to prompt for profile
21s to first UI
1m4s to read first email
= 1m27.4s

(In reply to Richard Leger from comment #11)

I have uploaded a performance profile hoping it may help identify the issue:
https://share.firefox.dev/39AMPPA (using 79 beta)
From TB startup till first email content appearing...

A significant percentage in graphics, nsMsgDBFolder::GetChildWithURI, and cardForEmailAddress

Some of those correlate to bug 1657565. It will be interesting to retest your issue after some of those items are resolved

Depends on: 1657565
Flags: needinfo?(richard.leger)
Depends on: 1660672

(In reply to Wayne Mery (:wsmwk) from comment #14)

Richard,

How is it now with https://archive.mozilla.org/pub/thunderbird/candidates/80.0b4-candidates/build1/ ?

(In reply to Wayne Mery (:wsmwk) from comment #14)

Richard,

How is it now with https://archive.mozilla.org/pub/thunderbird/candidates/80.0b4-candidates/build1/ ?

Due to increase degradation of TB performance overtime in the past months, I have been running multiple tests and performance profile gathering in various setup, in the hope that would help developers pin-point the various performance culprits that are still hindering Thunderbird 80 (and 78 likely)... find results below...

Test environment:

  • TB 80.0b4 (64-bit)
  • Windows 10 Pro (64-bits) 1909
  • Fujitsu Lifebook U745

Results:

Timing below have been captured manually with a stopwatch separately from the perf profile, so correspond to the "user experience" upon visual changes. Indeed gathering a performance profile in itself has a toll/impact on performance, so each test below was run twice in a row, one to capture timing, once again to capture the corresponding perf profile.

# Perf Total Prompt FirstUI Read1stEmail Profile IMAP/SMTP Mailbox(es) KeepMessages Calendar(s) CalDAV Calendar(s) Enabled Calendar Offline Support Enabled TBStartMode
01 https://share.firefox.dev/3gr2x1C ~16s ~3s ~13s N/A Blank None N/A None N/A N/A Online
02 https://share.firefox.dev/2Ehx2tG ~27s ~2s50 ~18s ~7s[1] Default x3 None x4 All disabled N/A Offline
03 https://share.firefox.dev/2Esd7rE ~57s ~2s25 ~19s ~36s Default x3 None x4 All disabled N/A Online
04 https://share.firefox.dev/2QhJVpT ~47s ~2s33 ~20s ~24s[1] Default x3 None x4 x4 Enabled Offline
05 https://share.firefox.dev/2Yre6zo ~1min19[2] ~2s45s ~20s ~57s Default x3 None x4 x4 Enabled Online
06 https://share.firefox.dev/34vbvrY ~26s ~2s40 ~19s ~5s[1] Default x3 None x4 x4 Disabled Offline
07 https://share.firefox.dev/2QiHG60[4] ~13min[2][3] ~2s78 ~19s ~12min40s Default x3 None x4 x4 Disabled Online
  • Prompt Delay to reach the prompt to select a profile in Profile Manager
  • FirstUI Delay to reach the first UI appears after selecting a profile
  • Read1stEmail Delay to read content of first email selected after first UI appeared
  • TBStartMode As per Work Offline option available in Profile Manager set at startup prompt

[1] delay till calendar feature is loaded and list of Inbox messages appears on screen - indeed, in offline mode message content cannot be read as no cache enabled for messages.
[2] "Looking for folders..." for a long time...
[3] "Loading message..." for a long time... with Reminders windows keeping popping up...
[4] This perf profile only contains about the first 6mn because above that TB crashes upon exit while generating the perf profile that then become corrupted and un-readable by the profiler... Crash references are bp-27bead4e-c6f4-441f-b547-a71de0200823 and bp-f1592ec3-2ff5-4ff8-a9a9-dddfb0200823. TB process is possibly killed by TB or Windows because it takes too long to terminate before the full perf profile is saved into file or else issue.

Those tests seems to suggest that performance issue are still three-folded (and possibly more!):

  • TB itself (e.g blank profile) - Though some may argue that 16s to startup TB is a "normal" speed, personally I would tend to think it is very slow, if you think in term of computer speed :-) Maybe TB is loading way too many files due to modularisation, I am wondering if reducing their number could hep accelerate startup speed...
  • IMAP/SMTP related (e.g all calendar disabled) - Bug 1660672 (I just created it for the occasion!) - TB being primarily and email client, end-users shall have access to their emails as soon as possible upon statup - meaning priority to updating Inbox and message loading content in IAMP over the rest (updating folders, calendar loading shall be delayed or done after at idle time or when feature is accessed)
  • Calendar related when enabled (offline support or not) - Bug 1642292 among others...
  • And else possibly... Bug 1582578, Bug 1657565, Bug 1658062, etc...

Which all combined may be causing an overall poor performance of TB startup... and later during use intermittently...

I hope you would find those tests and results helpful...

Flags: needinfo?(richard.leger)

(In reply to Worcester12345 from comment #19)

Seeing slow behavior in this bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1639759#c4

This is not a useful comment as it doesn't actually tell us anything apart from you're having an issue. Also, please don't spam multiple bugs with these sort of comments. That just confuses things.

If you really want someone to look into it, please file a new bug with a performance profile attached. You can do this via MOZ_PROFILER_STARTUP=1 MOZ_PROFILER_SHUTDOWN=profile.json /path/to/thunderbird, you can then load the profile in https://profiler.firefox.com/ and share it from there.

Here are additional perf profiles for TB starting up with a blank profile

80.0b5 (64-bit)
https://share.firefox.dev/2QXlMoZ

81.0b2 (64-bit)
https://share.firefox.dev/3lMU9xf

Depends on: 1659558

Here are additional perf profiles for TB starting up with a blank profile

81.0b3 (64-bit)
https://share.firefox.dev/3bN7AZo

About 1s77 to get to Profile Manager Prompt, followed by 12s73 from selecting profile to first UI... a priori a slight improvement :-)

A possible light at the end of the tunnel... see Bug 1543953 Comment 19
...but not there yet... Bug 1543953 Comment 20...

(In reply to Richard Leger from comment #23)

A possible light at the end of the tunnel... see Bug 1543953 Comment 19
...but not there yet... Bug 1543953 Comment 20...

False hope :-(
Explanation Bug 1543953 Comment 21
Back to square one...

With v 78.3.1 I get (until I see the mail list)
without addons: 16s
with addons (tbsync + provider for carddav + provider for google calendar): 47s.

What puzzles me is, that with the exact same configuration yesterday, and even this morning, it was much much faster.

Richard, does this try build from bug 1669872 help? (it's not a calendar patch, but we suspect it is a significant patch for getting/indexing new messages.
Windows - https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/d0unv_rhSfGQ5Vb5CXwWJA/runs/0/artifacts/public/build/target.zip

Flags: needinfo?(richard.leger)

(In reply to Wayne Mery (:wsmwk) from comment #26)

Richard, does this try build from bug 1669872 help? (it's not a calendar patch, but we suspect it is a significant patch for getting/indexing new messages.
Windows - https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/d0unv_rhSfGQ5Vb5CXwWJA/runs/0/artifacts/public/build/target.zip

This target version appear to be TB 82.0b3 (64-bit).

I still see the same delay to access my first email as it is looking for folders and getting folder ACL still... so delay to load my first selected message still occurs... but the rest may be faster...

Testing online with my IMAP account with no cache of emails on the local computer...

From startup (with my stopwatch):
~2sec to get the Profile selection prompt <-- same as before
+~13sec to get first UI <-- improvement here it seems
+-5sec to get message list <-- the message list appear much quickly now without the null status appearing at the bottom of folder list pane...
+~42sec to get content of my first email - selected in the list as soon as it appeared - message content cannot load before looking for folder and getting folder ACL processing have completed...
=~1mn2s to read first message after startup - so that part is still not great :-)

Performance profiles:

Hope that help.

Flags: needinfo?(richard.leger)

Unfortunately those profiles lack symbols and so are not useful - guess try builds are like that.

But since 23 days ago, we have released 78.4.0 and 83 beta, both of which have the patch.

FYI, I upgraded to TB 83.0b1 (64-bit) and re-run the same tests... and got similar results...

From startup (with my stopwatch):
~2.5sec to get the Profile selection prompt
+~15sec to get first UI
+-6sec to get message list
+~42sec to get content of my first email
=~1mn5s to read first message after startup

Performance profiles:

After migrating I also had performance issues. Specially when deleting message (few sec latency) or when opening a new windows to write a message.
After lot of search I found an article explaining Anti-Virus would have an impact.
My PC is running Win 10 Home with Windows Defender (default AV).
I was not confident at all, but I added "Thunderbird.exe" in the "process" exclude list. Since then, TB78 is now behaving correctly!
No more latency 😊
This surprise me since TB68 did not have such performance issue.

This is worth to try.

(In reply to Richard Leger from comment #29)

FYI, I upgraded to TB 83.0b1 (64-bit) and re-run the same tests... and got similar results...

From startup (with my stopwatch):
~2.5sec to get the Profile selection prompt
+~15sec to get first UI
+-6sec to get message list
+~42sec to get content of my first email
=~1mn5s to read first message after startup

Performance profiles:

I noticed on my old work laptop (Latitude E6510) that 85.0b loads faster than 84.0b did by about 5-7 seconds. Have you tested with 84.0b (or perhaps with the newly minted 85.0b)?

Flags: needinfo?(richard.leger)

(In reply to Arthur K. [He/Him/His] from comment #31)

(In reply to Richard Leger from comment #29)

FYI, I upgraded to TB 83.0b1 (64-bit) and re-run the same tests... and got similar results...

From startup (with my stopwatch):
~2.5sec to get the Profile selection prompt
+~15sec to get first UI
+-6sec to get message list
+~42sec to get content of my first email
=~1mn5s to read first message after startup

Performance profiles:

I noticed on my old work laptop (Latitude E6510) that 85.0b loads faster than 84.0b did by about 5-7 seconds. Have you tested with 84.0b (or perhaps with the newly minted 85.0b)?

I you are using Windows Defender, did you tried to add Thunderbird to its exclude list? This did really solve the slow performance issue on my ASUS ROG (i7, SSD, 16Go RAM, etc...).

(In reply to Sebastien C. from comment #32)

I noticed on my old work laptop (Latitude E6510) that 85.0b loads faster than 84.0b did by about 5-7 seconds. Have you tested with 84.0b (or perhaps with the newly minted 85.0b)?

I you are using Windows Defender, did you tried to add Thunderbird to its exclude list? This did really solve the slow performance issue on my ASUS ROG (i7, SSD, 16Go RAM, etc...).

No, my office PC uses Symantec (aka Broadcom) Endpoint Protection (14.3.0 RU1) and it's not managed by me but by our Sec admin. Symantec does their own whitelisting so apps that have been vetted are always greenlit per an always updating whitelist.

It's for sure an app change that happened some time in the past 1-2 years. On my more capable home PC, I can launch 85.0b2 from cold start and it's up and settled in 8-10 seconds (zero activity in the Status Bar). My office PC is pretty old and using only SATA II but on an SSD. It's likely that my 21+ year old 54GB profile could be slowing things down. I would think 21+ years of upgrading and changes will leave behind a LOT of cruft and dead settings/junk lingering that cannot be accounted for.

I understand your point (concerning the 21+ years of dev). To be more clear, when I gave my PC config, it was to make the point even on a fast and recent machine, TB was horribly slow until I added it in the AV white list. 😊

(In reply to Sebastien C. from comment #34)

I understand your point (concerning the 21+ years of dev). To be more clear, when I gave my PC config, it was to make the point even on a fast and recent machine, TB was horribly slow until I added it in the AV white list. 😊

I know that even with Symantec running AV/AM, Defender is happily running co-pilot (even if the pretty slider is set to Off position). Where did you add it to the Whitelist so that I can try this out for myself? If I remember correctly, I have Defender-related services disabled via registry hacks but I'll try anything to be 100% sure.

(In reply to Arthur K. [He/Him/His] from comment #35)

I know that even with Symantec running AV/AM, Defender is happily running co-pilot (even if the pretty slider is set to Off position). Where did you add it to the Whitelist so that I can try this out for myself? If I remember correctly, I have Defender-related services disabled via registry hacks but I'll try anything to be 100% sure.

The procedure is available here → How To Add Exclusions for Windows Defender in Windows 10
After adding thunderbird.exe in this white list, the slow performance issue has vanished on my Laptop. 😁

(In reply to Sebastien C. from comment #36)

The procedure is available here → How To Add Exclusions for Windows Defender in Windows 10
After adding thunderbird.exe in this white list, the slow performance issue has vanished on my Laptop. 😁

Yes, but does this open you up to potential malware or viruses through email?

(In reply to Worcester12345 from comment #37)

(In reply to Sebastien C. from comment #36)

The procedure is available here → How To Add Exclusions for Windows Defender in Windows 10
After adding thunderbird.exe in this white list, the slow performance issue has vanished on my Laptop. 😁

Yes, but does this open you up to potential malware or viruses through email?

Since I have Symantec Endpoint Protection installed, the options in that article don't work nor do they show so it's moot.

This particular bug report is not AV related.

Summary: Slow performance of Thunderbird 78.x at startup → Slow performance of Thunderbird 78.x at startup. Not antivirus related.

(In reply to Wayne Mery (:wsmwk) from comment #39)

This particular bug report is not AV related.

Well, after upgrading to TB 78, it becomes very very slow to respond. After some searches on Google, I found this bug report which does correspond to my initial issue. A this end I found on the Mozilla some documentation explaining problems could occur with AV.
I added TB in my AV white list and the slow performance issue has complety vanished. I decided to share my experience if this could help other people. 😊

(In reply to Sebastien C. from comment #40)

(In reply to Wayne Mery (:wsmwk) from comment #39)

This particular bug report is not AV related.

Well, after upgrading to TB 78, it becomes very very slow to respond. After some searches on Google, I found this bug report which does correspond to my initial issue. A this end I found on the Mozilla some documentation explaining problems could occur with AV.
I added TB in my AV white list and the slow performance issue has complety vanished. I decided to share my experience if this could help other people. 😊

(In reply to Wayne Mery (:wsmwk) from comment #39)

This particular bug report is not AV related.

Might want to change it back.

(In reply to Worcester12345 from comment #41)

(In reply to Wayne Mery (:wsmwk) from comment #39)

This particular bug report is not AV related.

Might want to change it back.

No. Please read comment 12.

This bug is isn't a KB or bucket for all manner of performance issues. This bug is about Richard's issue.

(In reply to Arthur K. [He/Him/His] from comment #31)

I noticed on my old work laptop (Latitude E6510) that 85.0b loads faster than 84.0b did by about 5-7 seconds. Have you tested with 84.0b (or perhaps with the newly minted 85.0b)?

With TB 85.0b3 (64-bit) on my Fujitsu Lifebook U745 I do not find startup speed to be greater... on the contrary...

From startup (with my stopwatch):
~2.3sec to get the Profile selection prompt
+~19sec to get first UI
+-35sec to get message list
+~40sec to get content of my first email
=~1mn36s to read first message after startup - worth than previously tested

Same result on both ADSL connection and 4G connection... with ping average response time to the server about 37ms...

Also seems slower to edit calendar items in that particular version for some reason (slow to open items, slow to save them, slow to refresh the views).

Flags: needinfo?(richard.leger)

(In reply to Richard Leger from comment #43)

(In reply to Arthur K. [He/Him/His] from comment #31)

I noticed on my old work laptop (Latitude E6510) that 85.0b loads faster than 84.0b did by about 5-7 seconds. Have you tested with 84.0b (or perhaps with the newly minted 85.0b)?

With TB 85.0b3 (64-bit) on my Fujitsu Lifebook U745 I do not find startup speed to be greater... on the contrary...

From startup (with my stopwatch):
~2.3sec to get the Profile selection prompt
+~19sec to get first UI
+-35sec to get message list
+~40sec to get content of my first email
=~1mn36s to read first message after startup - worth than previously tested

If I disable all Calendars (I had x3 enabled) I get:

From startup (with my stopwatch):
~2.5sec to get the Profile selection prompt
+~18sec to get first UI
+-19sec to get message list
+~33sec to get content of my first email
=~1mn12s to read first message after startup - worth than previously tested

In a blank profile:

~2.7sec to get the Profile selection prompt
+~13sec to get first UI
=~0mn15s to open TB

Attached image cal-props.png (deleted) —

(In reply to Richard Leger from comment #44)

From startup (with my stopwatch):
~2.5sec to get the Profile selection prompt
+~18sec to get first UI
+-19sec to get message list
+~33sec to get content of my first email
=~1mn12s to read first message after startup - worth than previously tested

In a blank profile:

~2.7sec to get the Profile selection prompt
+~13sec to get first UI
=~0mn15s to open TB

So based on the above numbers with Cals disabled you're only shaving off +/- 24s so still not the meat and potatoes of the issue at this point even with 85.x. I know you'd gone into great detail in this and some other bugs about the suspect code.

85.0b3 has had a couple wonky issues I've noticed. Mainly slow to shut down when closing the program. But I think I see a lot of good back-end things coming for 86.x so hopefully that's when some of this slowness will be reduced.

Refresh my memory again about where your Cals reside? Meaning, if you CTRL-SHIFT-C > right-click one of your Cals and then look at what's in the Location field. Where is the Cal data pulling from? Please humor me as I've got Covid brain-melt the past 9+ months and a lot of this is way off my mental radar. How does what you have compare to my setting?
Do I remember correct that you DO have Offline Support disabled?

Sorry, I also meant to also ask: if your settings aren't like mine, what kind of numbers do you see if you do match up to how my settings are?

Attached image caldav_settings.png (deleted) —

While any AV would have an impact on performance due to inspection of file opened by TB (and there are quite a lot of them), it is the case for any application and impact shall be marginal here. This bug is to help speed up TB due to its own design "flaws" and to improve its own internal startup mechanism. If AV has a great impact on TB startup then a separate bug shall be opened to deal with that particular issue. My opinion is that by trying to modularise TB too into two many separate files, creates a performance tall by causing too many separate open file request with smaller chunk of data, instead of reducing the number of files and loading bigger chunk of data at once (more performant) as file seek and open is less performant that data read by OS design and hardware infrastructure. While having numerous file with small chunk of data is handy for development and debugging, maybe some of the file could be concatenated into one file during compilation time to reduce number of file required to be opened/loaded by TB at startup, which could potentially accelerate the process, but I don't know in which measure that may be possible.

Arthur find attached my CalDAV Network Calendar settings for answer your question. Please note that when I re-tested in my last comments, I had either:

  • only 3x network CalDAV calendars enabled (few more setup but disabled), the main one (4000+ items) set as per attached, the two other much smaller, with Offline Support disabled, one of them read-only.
  • or all disabled

I have enabled Offline Support on my main calendar as advised by dev team (it seems recent implementation is more reliable than previously though lately much slower to edit/save items) otherwise TB takes about 10mn+ to open! Other calendars have this option disabled (simply because from my experience the cache mode was buggy previously)
FYI, I am not able to enable all my Calendars(x9 in total) by default otherwise TB comes to a complete crawl at startup...

But as you mentioned, and as highlighted, while part of the startup slowness is coming from the Calendar feature, it is already reported and dealt with in separate dedicated bugs. Currently with the use of Offline Support option in Calendar settings it help hinder part of the slowness due to Calendar but again bug here is not related to Calendar, even-though yes it also have an small impact to the margin.

The fact remain that my TB takes 1mn30 to start prior I can read my first email which is the main issue here. It may be impacting me more than most because I have multiple IMAP accounts, and the main have is very big with hundreds of subfolders. Part of it is the Looking for Folders issue that is being dealt with in a separate bug, other parts are inerrant to TB startup mechanism and "slowness" in itself.

Looking forward to improvements in 86.x branch. We can revisit the issue then...

Thanks Richard. And it makes no difference populating the "User name:" field, right? Don't want to leave any stone unturned. I know you'd mentioned previously here and in the other bugs that you had a LOT of events to parse so likely it's why, in the end, it's ultimately still slow. There's still a lot of bugfixing and catching up left to do.

I was only interested in the format of the location where the CalDAV calendar resides. I thought perhaps it was using some old format (i.e. v1 instead of v2 location, etc.). I feel like when I recreated my calendars from scratch some of these fields that hadn't been populated before suddenly were.

(In reply to Arthur K. [He/Him/His] from comment #48)

Thanks Richard. And it makes no difference populating the "User name:" field, right?

(In reply to Arthur K. [He/Him/His] from comment #48)

Thanks Richard. And it makes no difference populating the "User name:" field, right?

Sorry I hadn't noticed the missing username but it was there and working at some point it is likely because I had disabled the calendar during testing and not fully re-enabled by re-entering my credentials... after re-enabled... which it may ask for... or a view issue in the current TB a I use but I don't think that is an issue, the calemdar was synching fine just slow startup if offline disabled and currently slow edit/save :-)

I was only interested in the format of the location where the CalDAV calendar resides.

I don't really know, likely v3 (as v4 is not yet approved as a standard). Only thing also I noticed its some timezone not properly recognised but that is down to Davical and Windows (non-standard way) of dealing with those. TB should be able to parse any format version 2, 3 or 4 at least if not 1 ;-)

In all honesty what ever issue are with TB and Calendars, I would expect TB to be able to deal with issues, what ever they are, in a user friendly manner, ideally, at least infor end-users,about those encounters with hints towards solution to fix ;-)

I have not recently looked at slow startup in details will wait 86 beta... to have another go...

Please do not add me too/advocacy style comments in this bug, they are pointless and do not help. This bug is already too long and too much varied detail to be useful.

Please do file separate bugs, detailing what you are seeing, and include a link to at least one startup profile. Without a profile, there will be very little that developers can do.

To generate a start-up profile:

  • Run Thunderbird with environment variables set: MOZ_PROFILER_STARTUP=1 MOZ_PROFILER_SHUTDOWN=profile.json /path/to/thunderbird
  • Let it finish starting, then shut down.
  • Visit https://profiler.firefox.com/ and load the profile.
  • Then share the profile, which will give you a link, that you can paste into a NEW bug. Please mark that bug as blocking "tb-startupperf" (aka bug 487832).

Hi,

This bug is still relevant about the poor performance and slowness of TB as a whole... especially at startup... that still exists in current Beta version!

Of course it is not all down to one particular and specific issue but a multitude of them that add up.
The point here is to be able to identify some of them to allow raising specific dedicated bug report that can be reviewed specifically to have them resolved individually.

The below hopefully help the Dev Team to identify some of those and raise specific separate bug report where relevant.

As an end-user here is what I can gather so far...

Mark, if you have a chance to look at those and identify some bottleneck that may be raised and resolved in separate bug reports, that might help move forward.

If you have any advice on how to identify such bottleneck in perf profile reports and how to best report them as separate bugs, that would help as well. I am personally not very acquainted in reading those perf profile reports in order to raise specific bug reports that would be relevant to the developers.

There is so much than an end-user can do without further guidance or help from Dev Team and other contributors.

Hopefully the above would be a step forward in improving TB performance especially for users with large data sets.

Regards,
Richard

Richard,

Just checking in to see if you've tried with 86.0b1/b2? Though I doubt it's enabled or would have any impact, can you see what it says for Tools > Options > General > Network & Disk Space > Connection "Settings" button. Is Enable DNS over HTTPS enabled? If it's enabled, could you try disabling and see if it seems any different?

Same problem here using Thunderbird under Windows 7.
Please see https://bugzilla.mozilla.org/show_bug.cgi?id=1693810 to see my shared profile.

(In reply to Arthur K. [He/Him/His] from comment #54)

Richard,

Just checking in to see if you've tried with 86.0b1/b2? Though I doubt it's enabled or would have any impact, can you see what it says for Tools > Options > General > Network & Disk Space > Connection "Settings" button.
Is Enable DNS over HTTPS enabled?
If it's enabled, could you try disabling and see if it seems any different?

Flags: needinfo?(richard.leger)

(In reply to Wayne Mery (:wsmwk) from comment #57)

(In reply to Arthur K. [He/Him/His] from comment #54)

Richard,

Just checking in to see if you've tried with 86.0b1/b2? Though I doubt it's enabled or would have any impact, can you see what it says for Tools > Options > General > Network & Disk Space > Connection "Settings" button.
Is Enable DNS over HTTPS enabled?
If it's enabled, could you try disabling and see if it seems any different?

I am now on 87.0b2 (64-bit), would that be ok to run the test in this version?
The option seems disabled (not ticked) in my case... but I have only checked in my legacy profile not in a newly created profile...

Flags: needinfo?(richard.leger)

(In reply to Richard Leger from comment #58)

(In reply to Wayne Mery (:wsmwk) from comment #57)

(In reply to Arthur K. [He/Him/His] from comment #54)

Richard,

Just checking in to see if you've tried with 86.0b1/b2? Though I doubt it's enabled or would have any impact, can you see what it says for Tools > Options > General > Network & Disk Space > Connection "Settings" button.
Is Enable DNS over HTTPS enabled?
If it's enabled, could you try disabling and see if it seems any different?

I am now on 87.0b2 (64-bit), would that be ok to run the test in this version?
The option seems disabled (not ticked) in my case... but I have only checked in my legacy profile not in a newly created profile...

I'm sure it's probably fine.

(In reply to Richard Leger from comment #58)

(In reply to Wayne Mery (:wsmwk) from comment #57)

(In reply to Arthur K. [He/Him/His] from comment #54)

Richard,

Just checking in to see if you've tried with 86.0b1/b2? Though I doubt it's enabled or would have any impact, can you see what it says for Tools > Options > General > Network & Disk Space > Connection "Settings" button.
Is Enable DNS over HTTPS enabled?
If it's enabled, could you try disabling and see if it seems any different?

I am now on 87.0b2 (64-bit), would that be ok to run the test in this version?
The option seems disabled (not ticked) in my case... but I have only checked in my legacy profile not in a newly created profile...

Unless you want to try with 87.0b3 which should be out soon-ish?

(In reply to Richard Leger from comment #58)

I am now on 87.0b2 (64-bit), would that be ok to run the test in this version?
The option seems disabled (not ticked) in my case... but I have only checked in my legacy profile not in a newly created profile...

87.0b3 is now available.

(In reply to Arthur K. [He/Him/His] from comment #61)

(In reply to Richard Leger from comment #58)

I am now on 87.0b2 (64-bit), would that be ok to run the test in this version?
The option seems disabled (not ticked) in my case... but I have only checked in my legacy profile not in a newly created profile...

87.0b3 is now available.

Small progress... at least no longer need to wait 10mn+ for TB to start in certain circumstances :-)
Well done... but still much to do for improving startup performance speed of TB :-)
Hopefully the below might help...

Blank profile - From startup till main UI appears - 23s
TB 87.0b3 https://share.firefox.dev/2NuKXkM

IMAP email only (all network calendar disabled) - From startup till first email can be read - ~54s
TB 87.0b3 https://share.firefox.dev/3loOX2N

IMAP email + calendar (cache enabled - Event in Current View set in unifinder) - From startup till first email can be read - ~1mn12s
TB 87.0b3 https://share.firefox.dev/3s0Qr5C

IMAP email + calendar (cache disabled - Event in Current View set in unifinder) - From startup till first email can be read - ~1mn19s
TB 87.0b3 https://share.firefox.dev/3vDMqGO

IMAP email + calendar (cache disabled - All Events set in unifinder) - From startup till first email can be read - ~1mn57s
TB 87.0b3 https://share.firefox.dev/3lrhjcB

Additional perf profile for TB Daily 2021-03-15-10-40-12-comm-central available at Bug 163964 Comment 30 which show that just the "Looking for folders..." (as in IMAP folders) contribute to about 23s delay in my case (it was also noticed that the first time discovery and populated folders takes much more time than in the past with previous ESR). As suggested there, the "Looking for folders..." could be delegated to a webworker perhaps (or disabled at startup? but it has its drawbacks), not to block the loading message process and therefore to allow access to email content while folders are being processed in a background thread... the IMAP Folder discovery process itself may be reviewed to look at improving it in term of speed...

Also apart additional issues from CalDav feature, someone may also have uncovered possible others in Bug 1693810 related to cache at startup... still to be clarified as it may be linked to EMET service possibly in that particular case...

what is the size of your prefs.js and panacea.dat files ?

Blank profile - From startup till main UI appears - 23s
TB 87.0b3 https://share.firefox.dev/2NuKXkM

With EMET? And if so, what is seen without EMET? (it's pretty crucial that we have a comparison)

While it may be helpful in other bugs, I think calendar related items are best handled in the other bugs ... plus perhaps more easily dealt with after other baseline items in Thunderbird have been successfully identified.

Flags: needinfo?(richard.leger)

(In reply to Richard Leger from comment #62)

Small progress... at least no longer need to wait 10mn+ for TB to start in certain circumstances :-)
Well done... but still much to do for improving startup performance speed of TB :-)

Thanks for reporting back. Glad to hear things are at least improving in some parts of TB.

(In reply to Wayne Mery (:wsmwk) from comment #63)

what is the size of your prefs.js and panacea.dat files ?

94KB and 5337KB receptively...

Flags: needinfo?(richard.leger)
Attached image NoEMETService.png (deleted) —

(In reply to Wayne Mery (:wsmwk) from comment #63)

Blank profile - From startup till main UI appears - 23s
TB 87.0b3 https://share.firefox.dev/2NuKXkM
With EMET? And if so, what is seen without EMET? (it's pretty crucial that we have a comparison)

No EMET service running... see attached... nor any EMET software installed...

How are you starting thunderbird? Are you starting using profile manager, command line, ...?

Flags: needinfo?(richard.leger)

(In reply to Wayne Mery (:wsmwk) from comment #67)

How are you starting thunderbird? Are you starting using profile manager, command line, ...?

I use profile manager but it is preset with the right profile selected so as soon as it appears I press Start button immediately... hope that make sense...

Flags: needinfo?(richard.leger)

(In reply to Richard Leger from comment #68)

(In reply to Wayne Mery (:wsmwk) from comment #67)

How are you starting thunderbird? Are you starting using profile manager, command line, ...?

I use profile manager but it is preset with the right profile selected so as soon as it appears I press Start button immediately... hope that make sense...

Ideally, for consistent benchmarks, I think it would be better if no profile manager prompt.
If you need to switch profiles when benchmarking use
thunderbird.exe -P "case sensitive profile name"

(In reply to Richard Leger from comment #62)

(In reply to Arthur K. [He/Him/His] from comment #61)

(In reply to Richard Leger from comment #58)

I am now on 87.0b2 (64-bit), would that be ok to run the test in this version?
The option seems disabled (not ticked) in my case... but I have only checked in my legacy profile not in a newly created profile...

87.0b3 is now available.

Small progress... at least no longer need to wait 10mn+ for TB to start in certain circumstances :-)
Well done... but still much to do for improving startup performance speed of TB :-)
Hopefully the below might help...

Blank profile - From startup till main UI appears - 23s
TB 87.0b3 https://share.firefox.dev/2NuKXkM

According to those who know the profiler (florian) ...

first it sleeps for 5s waiting for the user profile lock. i.e. the previous shutdown was not finished

Then you have about 1s of the things that are also slow in Firefox (add-on manager and telemetry startup).
resource://gre/modules/devtools-loader.jsm is Thunderbird specific and looks like it has room for optimization (but it's only 100ms-ish in your profile)
Importing resource:///modules/gloda/GlodaMsgSearcher.jsm also takes 110ms, mostly by importing many other modules. Most of these imports should be made lazy.

In the Marker Chart, look for places where there are several rows of "ChromeUtils.import" or "SubScript" markers. These nested inclusions often indicate that things should be made lazy
Note: disk I/O seems to be fast on your machine (it's mostly CPU time in the profile), but these imports will take much longer on machines with slow disks.

resource:///modules/WindowsJumpLists.jsm "startup" takes 208ms during a time when the UI is already unresponsive (right after the " mail-startup-done" observer notification). This should likely be defered (eg. using an idle callback)

The last thing that takes a while is calendar startup, that uses your CPU and blocks the UI for about 1s.

(In reply to Wayne Mery (:wsmwk) from comment #69)

(In reply to Richard Leger from comment #68)

(In reply to Wayne Mery (:wsmwk) from comment #67)

How are you starting thunderbird? Are you starting using profile manager, command line, ...?

I use profile manager but it is preset with the right profile selected so as soon as it appears I press Start button immediately... hope that make sense...

Ideally, for consistent benchmarks, I think it would be better if no profile manager prompt.
If you need to switch profiles when benchmarking use
thunderbird.exe -P "case sensitive profile name"

I use it in all my benchmarks and in my daily use of TB so I would rather keep it fir consistency it is only 1-2s overhead... TB shall be fadt to start with profile manager anyway so not irrelevant to include it...

(In reply to Wayne Mery (:wsmwk) from comment #70)

(In reply to Richard Leger from comment #62)

(In reply to Arthur K. [He/Him/His] from comment #61)

(In reply to Richard Leger from comment #58)

I am now on 87.0b2 (64-bit), would that be ok to run the test in this version?
The option seems disabled (not ticked) in my case... but I have only checked in my legacy profile not in a newly created profile...

87.0b3 is now available.

Small progress... at least no longer need to wait 10mn+ for TB to start in certain circumstances :-)
Well done... but still much to do for improving startup performance speed of TB :-)
Hopefully the below might help...

Blank profile - From startup till main UI appears - 23s
TB 87.0b3 https://share.firefox.dev/2NuKXkM

According to those who know the profiler (florian) ...

first it sleeps for 5s waiting for the user profile lock. i.e. the previous shutdown was not finished

That does not sound normal, first I use the menu Exit to quit TB and wait for all windows to close and taskbar icon to become inactive, then I wait a bit more before I browse into folders to access and run my batch that allows me to record perf profile at startup, in which I have a switch menu to choose the TB version I want to start... so it start several seconds after previous TB exited visually, by that time there should not be no delay due to profile locking from previous session... could it be that something is missing or causing delay at exit?

Having spent a lot of time using the windows task manager, I can assure you that up to a minute after the last window is torn down is quite common here before the process ceases. It drops from an application to a task as the last window is torn down. But it is still there.

Likewise extended shutdown of Firefox follows the same path There are obviously background task that complete regardless of the program shutting down. Probably not related to shutdown, just delaying it. I assume disk I/O as my disk is very slow.

(In reply to Richard Leger from comment #62)

(In reply to Arthur K. [He/Him/His] from comment #61)

(In reply to Richard Leger from comment #58)

I am now on 87.0b2 (64-bit), would that be ok to run the test in this version?
The option seems disabled (not ticked) in my case... but I have only checked in my legacy profile not in a newly created profile...

87.0b3 is now available.

Small progress... at least no longer need to wait 10mn+ for TB to start in certain circumstances :-)
Well done... but still much to do for improving startup performance speed of TB :-)
Hopefully the below might help...

I'm curious to see how 88.0b3 will perform for you once it's officially out. I'm testing with the new build and on my slow office laptop, from cold start to when I see no more activity on the status bar, I am now seeing it take about about 25-27 seconds. I tried 5 times in a row and got about the same time results. When I timed 88.0b2 and prior betas, it was taking about 35-40 seconds or so. In my case, this new beta seems to start faster. I'm going to test at home on my more powerful PC where it takes about ~10 seconds. If I see anything improve there, I'll follow up.

For others seeing this issue, check bug 163964 comment 46 for something to test

(In reply to Wayne Mery (:wsmwk) from comment #75)

For others seeing this issue, check bug 163964 comment 46 for something to test

To test with the link available bug 163964 comment 46 yoy can use the instructions available in Bug 1660672 Comment 20.

While testing, be aware of a known issue with self signed certificate as reported in Bug 163964 Comment 48 currently in the fixing...

91.0b5 has been pretty snappy in terms of startup on my old office PC. From what I mention in comment 47, it now takes about 20-25 seconds after loading three gmail accounts and two calendars before the status bar stops showing any activity.

HI Arthur,

(In reply to Arthur K. [He/Him] from comment #77)

91.0b5 has been pretty snappy in terms of startup on my old office PC. From what I mention in comment 47, it now takes about 20-25 seconds after loading three gmail accounts and two calendars before the status bar stops showing any activity.

Thank you for your feedback, I did noticed as well much startup improvement in recent betas... and yes TB 91.0b5 (64-bit) is snappier than previous version of TB.

Many many thank you to all those that made such long awaited improvements a reality!!!

But I am still affected by Bug 163964 (fix in progress) which remain a culprit as emails can still not been immediately read upon startup (Download Message stuck) due to the IMAP Looking for folders process (updating the list of folders in the IMAP account) only up completion of that process, the selected message can be loaded and shown in preview pane.

Once that remaining issue would have been resolved (the fix is very promising in term of speed improvement), then I think TB would start quite quickly allowing to read email while in online mode almost instantly (as soon as view is available). +1

I am also obliged to use the offline mode for calendar so that help at the minute, ideally I would like to work completely online without any data locally cached on the computer without impeding perf at startup more than due to network performance... so they may still need some improvements with calendar system but that is for another day... let see where we will be at after Bug 163964 is fixed...

Regards,

Depends on: 163964
Depends on: 1543953

(In reply to Richard Leger from comment #78)

... let see where we will be at after Bug 163964 is fixed...

That is now also fixed in release 91.

We know that calendar still has issues to be resolved. But how are things now, Richard?

Flags: needinfo?(richard.leger)

(In reply to Wayne Mery (:wsmwk) from comment #79)

(In reply to Richard Leger from comment #78)

... let see where we will be at after Bug 163964 is fixed...

That is now also fixed in release 91.

We know that calendar still has issues to be resolved. But how are things now, Richard?

Just upgraded to Thunderbird Beta 97.0b2 (64-bit) and startup speed has drastically improved. I seem to be able to access first email within about 7sec which is a record!!! I will see how it goes over time but seems to be going at the speed of light... many many many thanks for this performance bump...

Hopefully calendar issues can be addressed next...

Flags: needinfo?(richard.leger)
Keywords: meta
Summary: Slow performance of Thunderbird 78.x at startup. Not antivirus related. → [meta] (Richard) Slow performance of Thunderbird 78.x at startup. Not antivirus related.

(In reply to Richard Leger from comment #80)

(In reply to Wayne Mery (:wsmwk) from comment #79)

(In reply to Richard Leger from comment #78)

... let see where we will be at after Bug 163964 is fixed...

That is now also fixed in release 91.

We know that calendar still has issues to be resolved. But how are things now, Richard?

Just upgraded to Thunderbird Beta 97.0b2 (64-bit) and startup speed has drastically improved. I seem to be able to access first email within about 7sec which is a record!!! I will see how it goes over time but seems to be going at the speed of light... many many many thanks for this performance bump...

Hopefully calendar issues can be addressed next...

The startup improvements made in 104.0b1 and, especially, in 105.0b1 are very, very noticeable. Richard, I'd be shocked if your slowness is still an issue once you update to 105.0b1. Are you able to give an update once you test out 105.0b1 so we can finally inch closer to closing this bug?

I usually like to wait a couple of betas before upgrading so I'll revert back to you later...

Flags: needinfo?(richard.leger)
Whiteboard: [closeme 2022-10-01]

Hello Arthur,

(In reply to Arthur K. [He/Him] from comment #81)

The startup improvements made in 104.0b1 and, especially, in 105.0b1 are very, very noticeable. Richard, I'd be shocked if your slowness is still an issue once you update to 105.0b1. Are you able to give an update once you test out 105.0b1 so we can finally inch closer to closing this bug?

I can confirm indeed that TB 105.0b2 (64-bit) start quickly... 1s to get to the prompt for profile... 1-2s more to see a screen of TB appearing... and about 7-8s in total to read my first email... improvements made TB rock fast at startup it seems.

One noticeable exception the Calendar feature. It still take about one min to gain access properly to my calendar.
Likely still affected by Bug 1543953 (too many network request) maybe this could be tacked next?
...and the time TB take to process each item (event/task) and view rendering... but there were an overall project in the pipeline for possible improvements work in that direction not sure where that is at, at the moment...

But in overall great great progress, thank you to all teams :-)
Keep going ;-)

Cheers,

Flags: needinfo?(richard.leger)

If Bug 1543953 is the only remaining piece, then the value as a meta bug is gone and I think we can close this

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: