Closed Bug 265457 Opened 20 years ago Closed 20 years ago

GetEventsForRange is inefficient

Categories

(Calendar :: Internal Components, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mvl, Assigned: mvl)

References

Details

Attachments

(2 files)

The way GetEventsForRange isn't efficients. It walks the array of items to find the next occurence of any event, and keeps on doing this. So it lwlks the entire array quite a few times. It does it this way to get a sorted list. The result is that it takes quite long. A better way would be to first walk the event to get all the occurences in the time range, then sort it.
Attached patch patch v1Splinter Review
Patch to do it. In a quick test, the function was about 25x as fast as before. Patch depends on the patch in bug 262620. Not because it is really needed, but because i didn't want to bitrot my own patches.
Comment on attachment 162865 [details] [diff] [review] patch v1 side note: i want to turn the eventOccurence class into oeICalEventOccurence when that is ready. (guess how i found the inefficient code :) )
Attachment #162865 - Flags: first-review?(mostafah)
Ofcourse, we can do the same for GetFirstEventsForRange(), which is used for the list of events.
Attachment #162881 - Flags: first-review?(mostafah)
Blocks: 244337
Comment on attachment 162865 [details] [diff] [review] patch v1 Patch checked in, after fixing indents.
Attachment #162865 - Flags: first-review?(mostafah) → first-review+
Comment on attachment 162881 [details] [diff] [review] same for GetFirstEventsForRange Patch checked in, after fixing indents
Attachment #162881 - Flags: first-review?(mostafah) → first-review+
Fixed in CVS. Thanks for the great work mvl
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Mass move of libxpical bugs to the Internal Components, per ctalbert.
Component: libxpical → Internal Components
The bugspam monkeys have been set free and are feeding on Calendar :: Internal Components. Be afraid for your sanity!
QA Contact: gurganbl → base
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: