Closed Bug 337531 Opened 18 years ago Closed 18 years ago

Improve sunbird startup time

Categories

(Calendar :: Sunbird Only, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: jminta, Assigned: jminta)

References

Details

Attachments

(1 file)

I've been poking around in where we spend time during startup on Sunbird.  The long stick is still gCalendarWindow = new CalendarWindow(), and we can win a lot (~20%) of we finish killing it (bug 329582).  Until then, I have 2 minor tweaks that each gain us about ~8% that I'd like to land.
Attached patch 2 startup tweaksSplinter Review
The first part of this patch makes sure that we don't double-refresh the unifinder or the views.  They were already setting their content when they were initialized (in gCalendarWindow and prepareCalendarUnifinder) and update_date() forced them to refresh.  This patch adds a parameter to pass to update_date() to stop this from happening.  The normal midnight refresh won't pass this parameter, so it will still work.

The second part of this patch changes the stylesheet that we're using for setting calendar/category colors.  calendar.css has 166 rules that have to be looped through to find (or not find) the appropriate rule.  calendar-decorated-views.css has 6, making this loop much faster.
Attachment #221659 - Flags: first-review?(mvl)
(In reply to comment #1)
> Created an attachment (id=221659) [edit]
> The first part of this patch makes sure that we don't double-refresh the
> unifinder or the views.  They were already setting their content when they were
> initialized (in gCalendarWindow and prepareCalendarUnifinder) and update_date()
> forced them to refresh. 

How about making the other initializers not redraw the UI? That way, there is one place that always updates the UI, and two that never updates. With the current patch, there are two that always update, and one that sometimes updates. Sounds more complex then needed.
(In reply to comment #2)
> (In reply to comment #1)
> > Created an attachment (id=221659) [edit]
> > The first part of this patch makes sure that we don't double-refresh the
> > unifinder or the views.  They were already setting their content when they were
> > initialized (in gCalendarWindow and prepareCalendarUnifinder) and update_date()
> > forced them to refresh. 
> 
> How about making the other initializers not redraw the UI? That way, there is
> one place that always updates the UI, and two that never updates. With the
> current patch, there are two that always update, and one that sometimes
> updates. Sounds more complex then needed.
> 
This is easy to go for prepareCalendarUnifinder, but with the current structure of gCalendarWindow, it's going to probably require more hacking than it's worth.  I think it'd be better to wait until we can kill gCalendarWindow to tackle that bit.
Comment on attachment 221659 [details] [diff] [review]
2 startup tweaks

Cancelling review.  We need gCalendarWindow to die, or at least shrink a lot to do this properly.
Attachment #221659 - Flags: first-review?(mvl)
Depends on: 329582
Note that these tweaks have now been included in various other patches as parts of refactoring.  I'll close this bug as soon as they land.
These changes have now been made in other bugs.
Status: NEW → RESOLVED
Closed: 18 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: