Re:HAML vs ERB vs SLIM in terms of render speed
by klaustopher on Wednesday October 17, 2012 @10:03AM
(#4664449)
I agree, If you would be using Express.js or something similar I think node would give you numbers that look more like the rails stuff.
But I'm really interested in eliminating as much of the framework as possible to get more comparable numbers even to other platforms.
I'm also sort of blown away by the throughput node allows you.
Re:HAML vs ERB vs SLIM in terms of render speed
by jashkenas on Wednesday October 17, 2012 @10:14AM
(#4664489)
Ok -- you got it. I've updated the gist with the same template running through Express.
https://gist.github.com/3905579
Take note that the margin of variance on these numbers is several hundred, so don't read too much into small shifts ... but:
With Express, and "c=1", I get 1,876 requests per second.
With Express, and "c=10", I get 2,730 requests per second.
There isn't meaningful overhead imposed by Express for this particular simple template rendering.
Re:HAML vs ERB vs SLIM in terms of render speed
by balupton on Wednesday October 17, 2012 @11:11AM
(#4664769)
Running the same benchmark against DocPad a node.js framework, getting good speeds too (1147req/s). Benchmark: https://gist.github.com/3906050
Worth noting the tests are being run against a local copy of - http://docpad-kitchensink.herokuapp.com/ - which does a lot more stuff than the basic haml rendering.
Re:HAML vs ERB vs SLIM in terms of render speed
by amikazmi on Wednesday October 17, 2012 @10:23AM
(#4664532)
You can make the benchmark with Rails Metal, or with Rack.
If you want to compare non-blocking IO, use with eventmachine.
While the rails benchmark tries to compare different template engines in the same language, framework, and with blocking IO, you're comparing these results to rendering under "pure" Node.js (no framework that slows you down) with non-blocking IO.
Don't take this the wrong way, tho, I'm absolutely blown away by your numbers!