Jquery Templates performance

点点圈 提交于 2019-12-07 04:26:32

问题


Is this technology intended for small templates or could be used to display large sets of data? Such as tables with 1000 rows and 20 columns?

How does the performance scale for cases such as these? The ideal and clean way to display the data would be to feed JSONified data returned from the Web Service to JQuery Template. It looks sleek in theory but does it fly in practice for large data sets?


回答1:


It depends a lot on the browser that does the rendering. IE6 can be fairly slow (though transferring 1,000 large rows of HTML markup and injecting that into the document is not going to be fast either).

Here's a jsperf benchmark that generates 1,000 rows of 10 columns and renders it. I'm averaging 200-250ms to render the 1,000 rows in Chrome 9.

The more important question should really be: Why in the world are you displaying 1,000 rows at once? There are always better UX alternatives than that.



来源:https://stackoverflow.com/questions/4590718/jquery-templates-performance

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