Is this a good way to demonstrate Nodejs (expressjs) advantage over Rails/Django/etc? Is this a good way to demonstrate Nodejs (expressjs) advantage over Rails/Django/etc? express express

Is this a good way to demonstrate Nodejs (expressjs) advantage over Rails/Django/etc?


To complement Sean's answer:

Benchmarks are useless. They show what you want to see. They don't show real picture. If all your app does is proxy requests to google, then evented server is a good choice indeed (node.js or EventMachine-based server). But often you want to do something more than that. And this is where Rails is better. Gems for every possible need, familiar sequential code (as opposed to callback spaghetti), rich tooling, I can go on.

When choosing one technology over another, assess all aspects, not just how fast it can proxy requests (unless, again, you're building a proxy server).


You're using Webrick to do the test. Off the bat the results are invalid because Webrick can only process on request at a time. You should use something like thin, which is built on top of eventmachine, which can process multiple requests at a time. Your time per request across all concurrent requests, transfer rate and connection times will improve dramatically making that change.

You should also keep in mind that request time is going to be different between each run because of network latency to Google. You should look at the numbers several times to get an average that you can compare.

In the end, you're probably not going to see a huge difference between Node and Rails in the benchmarks.