Open Bug 1786813 Opened 3 years ago Updated 1 year ago

performance: TB not responding for several minutes when accessing calendar with recurring task, with high CPU and high memory

Categories

(Calendar :: General, defect)

Thunderbird 86
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: gbl954, Unassigned)

References

Details

(Keywords: perf, Whiteboard: [has profile])

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0

Steps to reproduce:

Clicked "Calendar" icon on left menu bar.

Actual results:

Calendar tab opens, but not populated with events. After a minute or so, date matrix shows events, but event and task frames stay empty for several minutes. CPU usage spikes, to 100% intermittently, stays high, memory usage increases to over 3GB, after several minutes, CPU usages drops to less 10%, memory stays high.
I recorded a performance profile: https://share.firefox.dev/3PGiYbX

Expected results:

Calendar should fill in quickly, all frames as well. CPU should not remain high.

Component: Untriaged → General
Keywords: perf
Product: Thunderbird → Calendar
Whiteboard: [has profile]

Hmm. At initial glance looks like this could be icaljs related. Are you able to try with libical? Set the pref calendar.icaljs to false in the config editor then restart. Remember to restore it to true when you are done testing.

Flags: needinfo?(gbl954)

Lasana,
tried that, events frame loads quicker, tasks frame still take a minute or so.
Is there a way to collect a performance profile during TB startup? It often takes a couple of minutes before inbox is populated.

Flags: needinfo?(gbl954)

(In reply to gbl954 from comment #2)

Lasana,
tried that, events frame loads quicker, tasks frame still take a minute or so.
Is there a way to collect a performance profile during TB startup? It often takes a couple of minutes before inbox is populated.

I'm not sure if this works properly for TB but you can try:
https://profiler.firefox.com/docs/#/./guide-startup-shutdown

Here's a performance profile during startup with blank frames: https://share.firefox.dev/3cdyiiE

(I changed devtools.debugger.ui.panes-visible-on-startup to True, and started capture a soon as devtools window popped up.)

At a guess, I would say there could be one rogue event doing something weird like repeating every minute. No idea how you'd get in that situation, but the code for calculating occurrences is what's doing all the work in your first profile. Although weirdly, in the second profile it's the alarm service trying to do something.

Can you narrow it down to a particular calendar or event? If you can get to a point where you can select it in the display you should be able to copy to the clipboard and paste into a text editor or directly into an attachment here.

Here's an another performance profile where TB becomes unresponsive for about a minute: https://share.firefox.dev/3dUmtOC
(Calendar tab is not active in this run)

(In reply to Geoff Lankow (:darktrojan) from comment #5)

At a guess, I would say there could be one rogue event doing something weird like repeating every minute. No idea how you'd get in that situation, but the code for calculating occurrences is what's doing all the work in your first profile. Although weirdly, in the second profile it's the alarm service trying to do something.

Can you narrow it down to a particular calendar or event? If you can get to a point where you can select it in the display you should be able to copy to the clipboard and paste into a text editor or directly into an attachment here.

How would I narrow it down? It appears to be related to calendar functions, perhaps recurring tasks. Is there a way to turn-off calendar functionality without losing all event/task data to confirm that association?

Ok, I've narrowed it down to recurring tasks.
Steps taken to create issue:

  1. create new profile in profile manager
  2. start TB
  3. cancel setup of email
  4. add new calendar "Test"
  5. add task "Pickup mail" to calendar "Test"
    Occurs every workday at 10:00am, effective 8/25/1999
  6. Create task
    7)mark "completed" some of the earliest occurrences, i.e. 8/26/1999,
  7. Experience performance problem (I can't even get devtools to start).

(In reply to gbl954 from comment #7)

Ok, I've narrowed it down to recurring tasks.
Steps taken to create issue:

  1. create new profile in profile manager
  2. start TB
  3. cancel setup of email
  4. add new calendar "Test"
  5. add task "Pickup mail" to calendar "Test"
    Occurs every workday at 10:00am, effective 8/25/1999
  6. Create task
    7)mark "completed" some of the earliest occurrences, i.e. 8/26/1999,
  7. Experience performance problem (I can't even get devtools to start).

Couple of corrections:
I put in 8/25/2019 as effective date and tried to complete all of the tasks except today using checkbox, Ctrl-A and "mark "completed".
After ending TB in Windows and restarting, I was able to capture a performance profile: https://share.firefox.dev/3pIVOa2

Summary: performance: TB not responding when accessing calendar → performance: TB not responding when accessing calendar with recurring task
Version: Thunderbird 102 → Thunderbird 86
Duplicate of this bug: 1692001

gbl954 did you find if you set an frequency doesn't span more than say 5 years that the problem goes away?

Flags: needinfo?(gbl954)

No. I have given up on using recurring tasks in TB calendar.

Flags: needinfo?(gbl954)
Summary: performance: TB not responding when accessing calendar with recurring task → performance: TB not responding for several minutes when accessing calendar with recurring task, with high CPU and high memory

Did you have similar results at startup?
Is calendar properties set to "Offline Support"?

Flags: needinfo?(gbl954)

Don't know, I have given up on using recurring tasks in TB calendar.

Flags: needinfo?(gbl954)
You need to log in before you can comment on or make changes to this bug.