Closed
Bug 408727
Opened 17 years ago
Closed 16 years ago
Monthview is slow in sorting events
Categories
(Calendar :: Calendar Frontend, defect)
Calendar
Calendar Frontend
Tracking
(Not tracked)
RESOLVED
FIXED
0.8
People
(Reporter: mvl, Assigned: mvl)
Details
Attachments
(1 file)
4.71 KB,
patch
|
michael.buettner
:
review+
|
Details | Diff | Splinter Review |
The events for each day in the monthview are sorted using javascript's Array.Sort(). The array is build one item at a time. After each addition, the array is sorted. This means that an almost-sorted array is sorted using QuickSort. That's not good. (yes, this is also done when switching months. The views can't wait for all items to have arrived, due to async calendars) Suggestion: insert the item at the right place when building the array. No need to sort.
Assignee | ||
Comment 1•17 years ago
|
||
This patch is a proof-of-concept. A quick test shows that it seem to work, but I would like some more testing on it. Any volunteers? :) The same quick test showed that it reduces the time to switch months in a pretty busy calendar was reduced by roughly 20 to 40%.
Assignee | ||
Comment 2•17 years ago
|
||
Comment on attachment 293571 [details] [diff] [review] proof of concept v1 >Index: base/content/calendar-month-view.xml >+ this.mItemData.splice(i, 0, o); that 'o' should be 'newItem' ofcourse.
Assignee | ||
Updated•17 years ago
|
Attachment #293571 -
Flags: review?(michael.buettner)
Updated•17 years ago
|
Flags: wanted-calendar0.8+
Comment 3•17 years ago
|
||
Comment on attachment 293571 [details] [diff] [review] proof of concept v1 >+ this.mItemData.splice(i, 0, o); >+ > this.relayout(); > ]]></body> > </method> You have already found the error in the first line. Could you please remove the trailings spaces in the second line as well.
Updated•16 years ago
|
Assignee: nobody → mvl
Flags: wanted-calendar0.8+ → blocking-calendar0.8+
Updated•16 years ago
|
Status: NEW → ASSIGNED
Comment 4•16 years ago
|
||
Comment on attachment 293571 [details] [diff] [review] proof of concept v1 >+ this.mItemData.splice(i, 0, o); >+ See previous comments. Apart from that, no complaints, works like a charm. r=mickey.
Attachment #293571 -
Flags: review?(michael.buettner) → review+
Assignee | ||
Comment 5•16 years ago
|
||
patch checked in
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Updated•16 years ago
|
Target Milestone: --- → 0.8
Updated•16 years ago
|
Version: Trunk → unspecified
Comment 6•16 years ago
|
||
I think I see some improvement with this fix in. The months refresh a bit faster than with the nightly build performed on the 14th for 1.8 Mozilla trunk.
You need to log in
before you can comment on or make changes to this bug.
Description
•