| Issue 2344: | addEventSource slow with large number of array sources | |
| 1 person starred this issue and may be notified of changes. | Back to list |
My company is having some issues with some clients with very large calendars. For a small date range, they can have upward of 150 or more event sources, with 5 or more events each. As shown in the stress test (https://github.com/arshaw/fullcalendar/blob/master/tests/event_stress_test.html), adding a large number of events is handled very well and quickly. However, when you try to add the same number of events but with a large number of event sources, it takes almost a whole minute. Please see my jsfiddle for an example (http://jsfiddle.net/jonLtbzc/1/). This is clearly unusable for someone trying to click through months and having to wait a minute for each month to load. I believe this is due to the fact that the calendar calls reportEvents() after each source added. If all sources are added at once, then rendered only once, the calendar loads significantly faster. I have been able to see significant speedups with minor modifications to addEventSource() or by creating a new addEventSources() method. Here is my implementation for that method. Please keep in mind that this was created very quickly with very little understanding of the code so it will probably require some modification. function addEventSources(sourceInput) { if(sourceInput) { pendingSourceCnt = sourceInput.length; for(var i = 0; i < sourceInput.length; i++) { var source = buildEventSource(sourceInput[i]); if (source) { sources.push(source); fetchEventSource(source, currentFetchID); } else { pendingSourceCnt--; } } } }
Nov 17, 2014
Yes, each of the sources I am trying to add are arrays. In addition to the method I shared above, when I first ran into this issue I did also try what you noted about setTimeout and it appears to work great. I simply wrapped the fetchEventSource call within the addEventSource function with a setTimeout and it sped things way up. Not being familiar with your code, I was just unaware of any side effects this may cause.
Jun 7, 2015
hi there, I am also experiencing the same performqnce problem with multiple event sources using arrays, was this ever addressed in the latest updates?
Aug 21, 2015
Discussion for this issue has moved to the following URL: https://github.com/fullcalendar/fullcalendar/issues/2609 This is because Google Code is shutting down. Apologies if you are being pestered with these notifications. This is a one-time event. Happy coding, Adam
Status:
ExportedToGithub
|
|
| ► Sign in to add a comment |
Status: Accepted
Labels: Type-Bug