angular-ui / ui-calendar

A complete AngularJS directive for the Arshaw FullCalendar.
http://angular-ui.github.io/ui-calendar/
MIT License
1.49k stars 729 forks source link

Performance is 11 seconds for just 150 items #300

Open johneakin opened 9 years ago

johneakin commented 9 years ago

Hello, I am loading approx 150 items into the calendar, on first load this appears to perform relatively ok. (Presumably because it doesn't have to remove any items)

If I modify a calendar item, I then:

1) Remove all items from the calendar $scope.events.splice(0, $scope.events.length);

2) Reload all the items back in (150 items) angular.forEach(xxx, function (yyy, key) { var calEvent = blablabla $scope.events.push(calEvent); });

This is taking approximately 11 seconds to process, during that time even my loading animated icon freezes.

See attached image for performance, Any idea why its taking so long for just 150 items?

image

glebm commented 9 years ago

Try reassigning the events array instead of modifying the existing one -- that will call renderEvents once instead of N calls of renderEvent.

johneakin commented 9 years ago

Thanks this helps I used: $('#calendar').fullCalendar('removeEventSource', $scope.events); $('#calendar').fullCalendar('addEventSource', $scope.events);

Sefriol commented 9 years ago

This will probably help my on/off project as well. I noticed that the performance is also terrible when you try to drag existing events, when you have a lot of them. Does this occur to you too?

okdas commented 9 years ago

Same for me after upgrade.

Rolled back to ui-calendar 0.1.2.

joshkurz commented 9 years ago

can you create some type of example of this issue? We may have reverted some performance improvements that were made.

BorkoDragojlovic commented 9 years ago

Try: $scope.events=[]; $scope.events.push(calEvent);

nirmaladdon commented 9 years ago

same here,if we add 200 events by for loop it will hang the browser

see plunker for more detail http://plnkr.co/edit/KHvuiMyRZJImwBd2zVY2?p=preview

dwelch2344 commented 8 years ago

It seems like assigning a new variable breaks watches everywhere else. Anyone else notice that?

vitaliy-zakharov commented 8 years ago

I have the same issue with performance. Anybody have some solution? my browser alerts me "The script on this page stop working or busy"