News for hackers. Stuff that matters.
Re:Zapper: A Very Fast Templating Engine by pitaj on Tuesday June 26, 2018 @04:03PM (#17403585)
> Thirty times faster than Handlebars

This is versus the rust implementation of Handlebars. I'm not sure what the internals of that look like (whether it complies templates to native code or what).

I do know that the JS version compiles templates directly into string concatenation, so I wonder how Zapper running as wasm compares to rendering a compiled handlebars template.

Re:Zapper: A Very Fast Templating Engine by nicoburns on Tuesday June 26, 2018 @06:56PM (#17404626)
I did a whole bunch of benchmarking of template engines, and even went as far as to write my own a few tears ago when mobile devices were slow and I was trying to eke out extra performance.

Turns out the bottleneck is almost never interpolating the template, it's the browser parsing/creating the resultant DOM. This is true with both the innerHTML and createElement approaches to constructing the DOM.

Re:Zapper: A Very Fast Templating Engine by coder543 on Tuesday June 26, 2018 @08:02PM (#17404876)
This is true for client-side rendering of templates, but not necessarily true for server-side template rendering.
Re:Zapper: A Very Fast Templating Engine by coder543 on Tuesday June 26, 2018 @05:43PM (#17404222)
I would enjoy seeing that comparison too, but I have been too busy lately to put time into more comparisons.

If someone can show that the Rust implementation of handlebars is slower than the JavaScript one, that would be really fun and interesting to see on its own! I would imagine the Rust one is reasonably efficient, but HashMaps are tremendously slower than the fixed enums my code is generating at Rust compile time, and the Rust Handlebars implementation uses HashMaps extensively for substitutions.