Improve recurrence end date calculation and calendar start-up time
Categories
(Calendar :: Internal Components, enhancement)
Tracking
(Not tracked)
People
(Reporter: darktrojan, Assigned: darktrojan)
References
Details
(Keywords: perf)
Attachments
(2 files, 1 obsolete file)
In bug 1590665 I introduced an optimisation to avoid recalculating occurrences of events that had stopped recurring. While this worked as intended, it meant we had to calculate all occurrences of each event even if they happened well after the date range in question, so this made performance worse for some things.
Here I'm going to change how this optimisation works, to stop calculating occurrences after the date range in question. If we need a later date range the calculation will happen again. This should massively reduce the work done at start-up (immediately after the main window appears, but blocking the main thread so Thunderbird appears unresponsive) where the alarms service asks for all occurrences of everything.
| Assignee | ||
Comment 1•9 months ago
|
||
| Assignee | ||
Comment 2•9 months ago
|
||
Updated•9 months ago
|
| Assignee | ||
Comment 3•9 months ago
|
||
If a recurrence rule is immutable, the occurrences will never change, so there is no need to
calculate them more than once. In this patch I've added code to run through the calculation only
once (and only as far as is needed at the time), remember the output, then use the remembered
values for subsequent calls.
This optimisation makes the earlier recurrenceEndDate optimisation unnecessary, so I've removed
it. There is still potential for further optimisation using precalculated event start and end
times, but I've not investigated it yet.
| Assignee | ||
Updated•9 months ago
|
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/e87151847aad
Periodically yield the event loop while fetching calendar events from the database. r=mkmelin
https://hg.mozilla.org/comm-central/rev/6e76439652f7
In immutable recurrence rules, remember calculated occurrences for later reuse. r=mkmelin
Description
•