On Tue, Sep 23, 2014 at 3:14 PM, Alexey Petrushin < [email protected]> wrote:
> > I've programmed in both sync and async code, and neither is perfect. > Node basically > > has trade-offs - I get better performance [1] at the expense of a > slightly cumbersome programming model. > > I compared Node.js with "slow" Ruby on Rails and the result is that > node.js is only 1.3 times faster. > (maybe there's an error in my benchmark, but I can't find it so far). > > http://alex-craft.com/blog/2014/ruby-on-rails-vs-nodejs > sources https://github.com/alexeypetrushin/web-frameworks-benchmarks > Yes, like all benchmarks this one is horribly flawed. The simplest reason being your Rails server (using Puma) uses all cores. Your Node version is using one core. But that's beside the point - minor benchmarks like this show absolutely nothing of value. Try porting a real application. I did. > > Your sync version doesn't handle errors at all > > I knew that someone would point to it. But actually it does handle errors. > The whole request thread wrapped with try/catch (implicitly, inside of web > framework code) - and it does handle errors. > http://www.ckwop.me.uk/Why-Exceptions-Suck.html Besides that, not all ruby functions/methods throw exceptions on errors (thankfully - in fact I'd venture to say that most don't), so you have to handle them locally/manually anyway, same as you do in Node. Matt. -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CAPJ5V2aPsTWgb59Z8EnRji1FZf3RwdX9svJe64tjLc%3D3GwMaCw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
