Go vs Node.JS vs PHP + Iris vs Express vs Laravel

Thor

Honorary Master
Joined
Jun 5, 2014
Messages
44,236
Holy smokes php is dog slow

https://github.com/borislemke/nodejs_vs_php


PHP:
/**
 * Test results:
 * | Rank  | Subject                      | Requests/sec  | Data/sec   | Avg. Response |
 * -------------------------------------------------------------------------------------
 * |   1   | Iris(Go, Multi Thread)       | 57,589.26     | 7.80MB     | 3.88ms        |
 * |   2   | Pure Go(Multi Thread)        | 51,782.44     | 6.32MB     | 4.34ms        |
 * |   3   | Pure Node.js(Multi Thread)   | 20,873.34     | 3.09MB     | 11.40ms       |
 * |   4   | Pure Node.js(Single Thread)  | 10,375.05     | 1.53MB     | 22.70ms       |
 * |   5   | Express(JS, Multi Thread)    | 3,426.94      | 779.76KB   | 68.92ms       |
 * |   6   | Pure PHP(Multi Thread)       | 3,147.95      | 667.17KB   | 23.28ms       |
 * |   7   | Express(JS, Single Thread)   | 2,386.69      | 543.06KB   | 97.97ms       |
 * |   8   | Laravel(PHP, Multi Thread)   | 26.23         | 101.44KB   | 392.64ms      |
 * -------------------------------------------------------------------------------------
 */
 

Genisys

Honorary Master
Joined
Jan 12, 2016
Messages
11,216
Not too sure what the objectives are by testing Pure PHP and Laravel. Laravel is a framework. Of course it will be slower than pure php.
 

Thor

Honorary Master
Joined
Jun 5, 2014
Messages
44,236
Not too sure what the objectives are by testing Pure PHP and Laravel. Laravel is a framework. Of course it will be slower than pure php.

Everyone uses laravel these days same with express and iris so it is relevant adds some perspective.
 

Thor

Honorary Master
Joined
Jun 5, 2014
Messages
44,236
What about Cake? Zend? Yii? You do know that Wordpress is the most used even if its the most hated by developers.
Won't put WordPress in the same slight.

But same goes to you.

Pull, push, done.
 

Genisys

Honorary Master
Joined
Jan 12, 2016
Messages
11,216
Everyone uses laravel these days same with express and iris so it is relevant adds some perspective.
Actually, for enterprise development you are probably looking at some asp.net or Java based technology. Even if everyone hates on it, the fact is it is just better suited for Major services. Look at Stack Overflow. Not using PHP or the like, it uses ASP.net.
 

Other Pineapple Smurf

Honorary Master
Joined
Jun 21, 2008
Messages
14,593
Won't put WordPress in the same slight.

But same goes to you.

Pull, push, done.

For what they are trying to do with their new project hey should be benchmarking wordpress as well since it already has all the plugins they need to do their project ( I did first phase of a similar project 5 years ago in custom PHP and then looked at options for client of exporting to other frameworks including wordpress ).

But yes, PHP is slow.
 

Thor

Honorary Master
Joined
Jun 5, 2014
Messages
44,236
Actually, for enterprise development you are probably looking at some asp.net or Java based technology. Even if everyone hates on it, the fact is it is just better suited for Major services. Look at Stack Overflow. Not using PHP or the like, it uses ASP.net.

Look at facebook it uses php and Wikipedia

But I get your point, php is definitely not suited for youtube, google and the likes, Go seems pretty damn good thou...
 

[)roi(]

Executive Member
Joined
Apr 15, 2005
Messages
6,282
Dynamic & interpreted languages always have a cost, and PHP more than most. With JS, on the other hand, a lot of effort went into narrowing the gap by implementing proper code compilation (we can thank the browser vendors for that).

Overall compiled and memory optimized languages are always going to lead the pack.

Here's a more complete performance analysis:

PHP clearly is far behind the Go, C, C++ frameworks. FYI Rust and Swift frameworks compete directly with these ito memory optimisation / throughput, the only stranger in the bunch is Node.JS (considering what it is), isn't performing too bad.

The face of this is however going to change. Quite a few work is being done with new Functional Language frameworks, which have the added benefit of being easily parallelised. Facebook e.g. has been doing quite a bit work with Haskell focusing on realtime removal of spam; results are very positive.
 
Last edited:

Waansin

Well-Known Member
Joined
Feb 16, 2005
Messages
284
My simple GET on an existing Laravel 5.2 app did:

8474.60 Requests/sec
1.74MB Data/sec
6.44ms Avg. Response

And this is on a Macbook Air. The point is, if you set up your app properly, you get good performance. In this case, "properly" means decent caching and an experimental Web server.

Another point to keep in mind, when it comes to Web performance, anything can slow things down. Testing locally means nothing as you need to figure out real world user experience when your Web app is full of data and being hosted on the best service you can afford. For example: were you naive with how you deal with lots of data or did you load the front-end with too much bulk. Or maybe your host is just too far from your target users. All of these can be issues that will cause you similar if not more growing pains than choosing an inherently slow performing framework.

And Laravel is slow compared to all of the compiled language frameworks. It is inherently slow because of its routing and its over the top dependancy injection driven framework. But developer performance is super high with it and that trade-off is important.
 

flippakitten

Expert Member
Joined
Aug 5, 2015
Messages
2,486
This again...

I don't actually care.

I mean if you run your web app on a dedicated server and use the fastest language, optimized to the max it's not going to make any noticeable difference to captain mobile at 7pm when the towers get congested.

Don't let the speed of a language define which language you prefer.
If you gain some speed and less data but it takes you 2 day's longer to do anything, you're not saving anyone any money.
 

[)roi(]

Executive Member
Joined
Apr 15, 2005
Messages
6,282
If you gain some speed and less data but it takes you 2 day's longer to do anything, you're not saving anyone any money.
Careful too assume X "takes you 2 day's longer to do anything" versus Y -- that's a tough debate... should I prepare the popcorn?
 

flippakitten

Expert Member
Joined
Aug 5, 2015
Messages
2,486
[)roi(];18860820 said:
Careful too assume X "takes you 2 day's longer to do anything" versus Y -- that's a tough debate... should I prepare the popcorn?

Yeah yeah I know, it's generally up to the person doing the programming and if we're comparing development time, you'd probably be using a Framework and that's a whole other debate.

Quite simply though, I don't trust these benchmark tests anymore, they always biased towards one language. I could probably find a comparison that show's PHP beating Node because the person that wrote the article knows much more about PHP but as I said I don't care anymore anymore.

People have taken up React which can have an 8mb assest file (8 *****ing MB)... Who cares how long a process will take if it's gonna take 8 years to display in some cases but it has it's coolness, so it's used.

I like Python for reasons
I like PHP for reasons
I like Ruby for reasons
I like Node for reasons

Although I didn't see anyone actually saying X is better than Y, so I am just having an argument for no reason... my bad
 

semaphore

Honorary Master
Joined
Nov 13, 2007
Messages
15,194
Yeah yeah I know, it's generally up to the person doing the programming and if we're comparing development time, you'd probably be using a Framework and that's a whole other debate.

Quite simply though, I don't trust these benchmark tests anymore, they always biased towards one language. I could probably find a comparison that show's PHP beating Node because the person that wrote the article knows much more about PHP but as I said I don't care anymore anymore.

People have taken up React which can have an 8mb assest file (8 *****ing MB)... Who cares how long a process will take if it's gonna take 8 years to display in some cases but it has it's coolness, so it's used.

I like Python for reasons
I like PHP for reasons
I like Ruby for reasons
I like Node for reasons

Although I didn't see anyone actually saying X is better than Y, so I am just having an argument for no reason... my bad

You're doing something wrong if your react assets are 8mb, something very, very wrong. If i look at a project im using it on, its 400kb, even less gzip compressed.
 

[)roi(]

Executive Member
Joined
Apr 15, 2005
Messages
6,282
Yeah yeah I know, it's generally up to the person doing the programming and if we're comparing development time, you'd probably be using a Framework and that's a whole other debate.
...

Although I didn't see anyone actually saying X is better than Y, so I am just having an argument for no reason... my bad
uh-huh....
 
Top