FullCalendar - 我应该期望什么级别的事件渲染性能?
我使用 $('#CalendarPlugin').fullCalendar('renderEvent', {} );
在循环中调用 100 次,在 FullCalendar 中渲染 100 个事件。
我在计算机上看到的浏览器性能(Core2 6600 @ 2.4GHz,4GB RAM)
- Chrome:3秒
- Firefox:6秒
- < IE9:6 秒
这是预期的性能水平吗?有没有更快的方法来加载和渲染事件?
一旦它们被添加到 FullCalendar,在几个月之间移动并重新渲染它会更快。只是使用 renderEvent
初始加载它们的速度很慢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
开发人员正在致力于增强 1.4.4 版本的性能,但循环使用该插件 100 次仍然很严重。
您可以尝试提高性能的一种技术是在
addEventSource
中使用一个对象,因为我相信它会等待并完全渲染: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:这个想法是一次获取特定时间段内的所有事件,请查看 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/
一旦最初加载它们,您的性能就会提高,因为默认情况下事件会被缓存。
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.