FullCalendar - What level of events rendering performance should I expect?

余生长醉 提交于 2019-12-10 03:34:25

问题


I am rendering 100 events in FullCalendar using $('#CalendarPlugin').fullCalendar('renderEvent', {} ); being called 100 times in a loop.

The browser performance I'm seeing on my computer (Core2 6600 @ 2.4GHz with 4GB RAM)

  • Chrome: 3 seconds
  • Firefox: 6 seconds
  • IE9: 6 seconds

Is this an expected level of performance? Is there a faster way to load and render events?

Once they've been added to FullCalendar, moving between months and re-rendering it much faster. It's just the initial loading of them using renderEvent that's slow.


回答1:


The developer was working on performance enhancements for the 1.4.4 version, but hitting the plugin 100 times in a loop is still hefty.

One technique you could try to improve performance is to use an object in addEventSource as this waits and renders altogether I believe:

 $("#calendar").fullCalendar("addEventSource", msg.items);



回答2:


The idea is to fetch all events in a certain period at once, look at the api

http://arshaw.com/fullcalendar/docs/event_data/events_array/

http://arshaw.com/fullcalendar/docs/event_data/events_json_feed/

http://arshaw.com/fullcalendar/docs/event_data/events_function/

Your performance increases once they are loaded initially because by default events are cached.



来源:https://stackoverflow.com/questions/5950358/fullcalendar-what-level-of-events-rendering-performance-should-i-expect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!