Closed braddunbar closed 12 years ago
The standard I was using for "one of the fastest" was the top three fastest from a different jsperf that appeared to include largest number of engines (http://jsperf.com/javascript-templating-shootoff-extended/22). If you want to add Underscore without "with" to that larger list and see if it comes out on top, that would definitely be good info to have.
Will do. Thanks for the response @garann!
Here you go. I just added a case for underscore without the with block. It's definitely on par with doT (slightly slower, but far and away faster than the rest). Thanks again!
There were several things failing in the shootout, including engines being overwritten through variable conflicts (the test marked "resig" was actually using blueimp, doU was using doT, jsRender was completely broken, Template was "cheating" by using an internal cache...). I've updated it to the best of my ability:
http://jsperf.com/javascript-templating-shootoff-extended/25
Thanks @kirbysayshi!
@garann Ping! What do you think of the jsperf results? I don't mind if you leave it as is, just wanted to make sure you were aware of the recent speed improvements to _.template
. :)
@braddunbar Hey, sorry for the delay. I did check it out, and it looks like a huge difference in most browsers. But going by @kirbysayshi's jsperf, it looks like it's not quite fastest, yet. Though it is far ahead of most others.. Eh, what the heck. Pulling it in, but I reserve the right to go back to strictly top three if this ends up making things really confusing. ;)
Thanks @garann!
with
blocks are optional in underscore 1.3.3, yielding large performance improvements.