4 ms·
Nice, but is the templating engine really the bottleneck for your application? And if not, does it really matter that this implementation is 40 times faster?
by akie 15y ago
Nice, but is the templating engine really the bottleneck for your application? And if not, does it really matter that this implementation is 40 times faster?
- gthank 15y agoFor a lot of dynamic languages, at least, the templating engine is a surprisingly large portion of your page load times. I wish I could bring up the breakdown I saw a while back, but it's certainly non-trivial in many cases.
- akie 15y agoI would be very interested in those breakdowns. Does someone else maybe have some info on that?
- glassx 15y agoRyan Tomayko wrote a post on Ruby/C/Perl Markdown parsers and did some benchmarks a while ago: http://tomayko.com/writings/ruby-markdown-libraries-real-cheap-for-you-two-for-price-of-one http://tomayko.com/writings/ruby-markdown-libraries-real-che...
- vmind 15y agoA (niche) use may be to compile for NativeClient, to provide better responsiveness if you're doing large templated live-previews (though admittedly this is more sensible with formatting like markdown rather than templating).
- kneath 15y agoSometimes it's fun just to make things better, faster, stronger. Hard to find a downside to having your template engine faster.
- pointyhat 15y ago+1 - fun is the best reason to make something better, faster or stronger.
- thezilch 15y agoI have no experience with Ruby template engines, including Crustache and Mustache, but of course it matters about serving clients 40x times faster. 800ms to serve me what could be had in 20ms? Amazon, Google [1][2], and others have talked extensively on speed-to-conversion ratios. In Python land, there have huge improvements in template engines [3]. And they are not done; Jinja(2) author, Armin Ronacher, is working on a Google Summer of Code (GSoC) project [4] to speed up Django and Jinja2 templates. [1] http://googleresearch.blogspot.com/2009/06/speed-matters.html http://googleresearch.blogspot.com/2009/06/speed-matters.htm... [2] http://glinden.blogspot.com/2006/11/marissa-mayer-at-web-20.html http://glinden.blogspot.com/2006/11/marissa-mayer-at-web-20.... [3] http://stackoverflow.com/questions/1324238/what-is-the-fastest-template-system-for-python/1326219#1326219 http://stackoverflow.com/questions/1324238/what-is-the-faste... [4] https://www.djangoproject.com/weblog/2011/apr/25/gsoc/ https://www.djangoproject.com/weblog/2011/apr/25/gsoc/
- glassx 15y agoIMO, another nice side-effect of having library code in C is portability and easy code reuse, since lots of scripting languages can interface with it.