问题
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