Live data from Hacker News

Benchmarking Codswallop: Node.js vs. PHP

philsturgeon.co.uk

31–40 of 85 posts

Re: Benchmarking Codswallop: Node.js vs. PHP

#31
post #28

I'm sick of all of these generic SPEED benchmarks. Let me tell you some BIGGEST & REAL benefits of NodeJS where PHP SUCKS. 1. Takes 1 minute to install on any platform (*nix, windows etc.) 2. A modern Package Manager (NPM) works seamlessly with all platforms. 3. All libraries started from 0 with async baked in from day 0. 4. No need to use any 3rd party JSON serialize/deserialize libs. 5. And above all, its Atwood's…

[deleted]

Re: Benchmarking Codswallop: Node.js vs. PHP

#32
The "Thoughts" section was the most informative part of the benchmark which underscores the way I, when I was working with PHP, operated. When I started with PHP(2005), the frameworks were terrible, I would cobble together many random coding examples from stuff I found on the web and just make my own Framework up. I don't think PHP from a performance standpoint is any better or worse, but the default examples that you generally see in the ecosystem provide significantly worse performance. The one thing that Node clearly has an upper hand on PHP with is the ecosystem. It's a lot easier for a developer new to the Node ecosystem to hit that Node target than it would be for someone of the same skill to hit the PHP target in terms of hours spent.

One funny thing is that the ReactPHP[1] site is visually similar to the Node[2] homepage.

[1] - http://reactphp.org/ [2] - http://nodejs.org/

Re: Benchmarking Codswallop: Node.js vs. PHP

#34
post #28

I'm sick of all of these generic SPEED benchmarks. Let me tell you some BIGGEST & REAL benefits of NodeJS where PHP SUCKS. 1. Takes 1 minute to install on any platform (*nix, windows etc.) 2. A modern Package Manager (NPM) works seamlessly with all platforms. 3. All libraries started from 0 with async baked in from day 0. 4. No need to use any 3rd party JSON serialize/deserialize libs. 5. And above all, its Atwood's…

Yet there are no decent XML libraries for node.js.

I'd trade decent JSON support for decent XML support every single day of the week.

And Scala/Java/JVM have already solved the problems you mention above.

Re: Benchmarking Codswallop: Node.js vs. PHP

#35
post #28

I'm sick of all of these generic SPEED benchmarks. Let me tell you some BIGGEST & REAL benefits of NodeJS where PHP SUCKS. 1. Takes 1 minute to install on any platform (*nix, windows etc.) 2. A modern Package Manager (NPM) works seamlessly with all platforms. 3. All libraries started from 0 with async baked in from day 0. 4. No need to use any 3rd party JSON serialize/deserialize libs. 5. And above all, its Atwood's…

All your points are good apart from 4, don't the native json_encode() / json_decode() functions do what you need?

Re: Benchmarking Codswallop: Node.js vs. PHP

#36
post #33

ReactPHP does look great, hope it will be in stable enough state for production usage. Also it seems it's only done by one person?

Two core devs with a few contributors.

A lot of the components are in production already, it was built by the original developers to be used in production. It's on 0.3.0 for many parts, which is no further behind where Node was when people started flapping about it :)

Re: Benchmarking Codswallop: Node.js vs. PHP

#37
post #34
post #28

I'm sick of all of these generic SPEED benchmarks. Let me tell you some BIGGEST & REAL benefits of NodeJS where PHP SUCKS. 1. Takes 1 minute to install on any platform (*nix, windows etc.) 2. A modern Package Manager (NPM) works seamlessly with all platforms. 3. All libraries started from 0 with async baked in from day 0. 4. No need to use any 3rd party JSON serialize/deserialize libs. 5. And above all, its Atwood's…

Yet there are no decent XML libraries for node.js. I'd trade decent JSON support for decent XML support every single day of the week. And Scala/Java/JVM have already solved the problems you mention above.

1. libxmljs can take you pretty far with NodeJS.

2. Whatever we're saying here includes only NodeJS vs PHP.

Re: Benchmarking Codswallop: Node.js vs. PHP

#38
post #8

Benchmarking is very hard because even the same language could show different results. For example: for($i = 0; $i vs $count = count($list); for($i = 0; $i Most of the time benchmarks prove how capable a programmer is, not the speed of the language used.

Any decent compile-time optimizer will transform your first snippet into the second one (or better). Some languages preclude that optimization at compile time, but I presume that a JIT would also have little problem performing that optimization.

That is, one could argue that a good language is one that lets developers ignore trivial changes like this without hurting performance.

Re: Benchmarking Codswallop: Node.js vs. PHP

#39
post #23
post #4

I was always under the impression that PHP hate comes from design flaws that make it easy to make mistakes, not from it being necessarily slower.

Node.js is also based around a subpar language, so it's not necessarily the main cause either.

One might argue that Javascript is considerably less sub-par than PHP, though; speaking purely from my own experience, I've found that writing Javascript involves a significantly lower probability of the language attempting, at random intervals, to shatter my kneecaps with a crowbar.

Re: Benchmarking Codswallop: Node.js vs. PHP

#40
post #28

I'm sick of all of these generic SPEED benchmarks. Let me tell you some BIGGEST & REAL benefits of NodeJS where PHP SUCKS. 1. Takes 1 minute to install on any platform (*nix, windows etc.) 2. A modern Package Manager (NPM) works seamlessly with all platforms. 3. All libraries started from 0 with async baked in from day 0. 4. No need to use any 3rd party JSON serialize/deserialize libs. 5. And above all, its Atwood's…

Agree with all but #1.
Post reply on HN