Improve jQuery template performance

后端 未结 5 1157

Update

Apparently, jQuery templates can be compiled and it helps performance for templates with if statements shown here.

But a

5条回答
  •  無奈伤痛
    2021-02-19 20:06

    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.

提交回复
热议问题