Hacker News new | ask | show | jobs
by arthurschreiber 4987 days ago
Well, that comparison is not exactly fair, is it?

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!

1 comments

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.

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.

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.

You can make the benchmark with Rails Metal, or with Rack. If you want to compare non-blocking IO, use with eventmachine.
Yeah I'm pretty sure the rails benchmark is IO-bound. If that is the case it is surprising there is any noticeable difference at all between the three different Ruby template engines.