3 ms·
The problem with benchmarking raw node.js code is that not a lot of real web apps will look like that. Naked node.js pushes all the asynchronous complexity on t
by sedachv 16y ago
The problem with benchmarking raw node.js code is that not a lot of real web apps will look like that. Naked node.js pushes all the asynchronous complexity on the application writer - writing everything with callbacks is equivalent to hand-writing a state machine.
Since V8 does not have native continuation support, realistically it's going to devolve to libraries either doing CPS transformation (http://gfxmonk.net/2010/07/04/defer-taming-asynchronous-javascript-with-coffeescript.html http://gfxmonk.net/2010/07/04/defer-taming-asynchronous-java...) or monads (http://matthew.yumptious.com/2009/04/javascript/dojo-deferred-is-a-monad/ http://matthew.yumptious.com/2009/04/javascript/dojo-deferre...), which both involve performance penalties.
A fair comparison on say a 4-core machine would be 4 JVMs running Clojure webservers with some front-end, and 4 node.js instances running one of the library front-ends, with the benchmarked page written with one of the CPS-transforming toolkits (coffeescript, narrative JS, jwacs, etc.) or maybe monad toolkits if/when somebody decides to write one.