Update
Apparently, jQuery templates can be compiled and it helps performance for templates with if statements shown here.
But a
Nobody mentioned mustache. In the late 2011 mustache had the best performance from popular templating frameworks.
http://mustache.github.com/