Skip to content

Comment on PHP vs. Node.js: The REAL statistics

Comments

The truth is out. node.js was faster than PHP by more 14 times! These results are astonishing. It simply means that node.js IS going to be THE de-facto standard for writing performance driven apps in the upcoming future, there is no doubt about it!

While I enjoyed the benchmark test, I believe the conclusion that this is going to be de-facto as a result of it's high performance is a bit premature. There are so many factors (both right and wrong) that contribute to the widespread adoption to a language/framework/technology, performance often being less important than you'd at first think.

EDIT: I'm not suggestion node will or will not be a de-facto. I'm suggesting that the factors contributing to a languages widespread adoption are varied and complex.

>I'm suggesting that the factors contributing to a languages widespread adoption are varied and complex.

Yup, thats true, and being performance oriented isn't the only selling-point for node.js. The fact that all node apps are single-threaded (and thus conserve cpu capacity), combined with the functional-programming approach of javascript (which makes things like async I/O easier, don't hurt either.

I wouldn't say that single-threaded is a good thing, or that JavaScript is a functional language

@sportanova - If callbacks are available for everything, then what is th need for multi-threading. You can handle everything in your own thread. When required, runtime will give you a callback.

JavaScript indeed has functional programming features. See: https://en.wikipedia.org/wiki/Javascript

1) While it's possible to take advantage of multiple cores with Node, it's easier to do it with a system that supports multi-threading out of the box. Node's event loop model (and interface, in the form of callbacks) works well for IO intensive purposes, but hardly obviates the use of multi-threading (especially when some CPU intensive processing comes into play). 2) I think functional programming languages are best viewed on a spectrum, and Javascript falls pretty low on the spectrum. Higher than Java, but far behind Scala and way, way behind Haskell. It has closures and higher order functions, but so does Java 8, and I wouldn't call Java a functional language. Off the top of my head it's missing immutability, referential transparency, pattern matching, lazy evaluation, tail recursion, and monadic structures. Just because a language has or is missing a few of these doesn't mean it is / isn't functional, but relatively speaking, Javascript is pretty low on the spectrum.

I think D lang's vibe.d can take that performance crown with good documentation and some more libraries.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.