Jquery模板性能 [英] Jquery Templates performance

查看:71
本文介绍了Jquery模板性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此技术是用于小型模板还是可用于显示大量数据?如1000行20列的表?

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?

这些案件的绩效如何扩展?显示数据的理想和干净方式是将从Web服务返回的JSONified数据提供给JQuery模板。它在理论上看起来很圆滑但实际上是否适用于大型数据集?

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?

推荐答案

这在很大程度上取决于浏览器渲染。 IE6可能相当慢(虽然传输1,000行大量的HTML标记并将其注入到文档中也不会很快)。

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).

这是一个jsperf基准测试,可生成1,000行10列并呈现它。我平均需要200-250毫秒来渲染Chrome 9中的1000行。

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.

更重要的问题应该是:为什么世界上你一次显示1,000行?总有更好的用户体验替代品。

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.

这篇关于Jquery模板性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆