Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Very slow due to repeated unnecessary sorting #26

Open
trevoriancox opened this issue Jul 17, 2013 · 1 comment
Open

Very slow due to repeated unnecessary sorting #26

trevoriancox opened this issue Jul 17, 2013 · 1 comment

Comments

@trevoriancox
Copy link

In TouchCalendarEventsBase.js, sort is called on eventStore repeatedly, for every date. In my test, moving sort() to before dates.each() reduced the time to display a new month in month view from 3 secs to 0.5 secs (with 300 event records, Chrome desktop browser).

dates.each(function(dateObj){
            var currentDate = dateObj.get('date'),
                currentDateTime = currentDate.getTime(),
                takenDatePositions = []; // stores 'row positions' that are taken on current date

            // sort the Events Store so we have a consistent ordering to ensure no overlaps
            eventStore.sort(this.getPlugin().getStartEventField(), this.getEventSortDirection());
@trevoriancox
Copy link
Author

Also I think we should make the eventStore sort optional (skip if StartEventField is not set), as the eventStore may already be appropriately sorted.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant