D
D
devilsD2020-05-09 16:23:17
PHP
devilsD, 2020-05-09 16:23:17

Does nodejs outperform php in a typical site?

It is known that the processing speed of nodejs is comparable to compiled PLs. PHP in such tests loses dry like any interpreted language.
But how does nodejs behave on an ordinary monolithic site, for example, an IM, with a mysql / postgresql database, a web server and other standard web goodies compared to php. Not taking into account server settings, architecture, etc. The question is this: will the server response time on a nodejs site differ significantly from a site on php under the same conditions.
In particular, IM on laravel/yii, even when using caching, shows a delay of 200-300ms.
Will the metrics be different when using nodejs?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Belyaev, 2020-05-09
@devilsD

In the general case, it all depends on how to write, it is possible to write such brakes on the node that a well-optimized php, especially 7, will simply fly against this background.
Well, in most server applications, the main load falls on the database, which means that the speed will largely depend on it.
But due to asynchronous operation, the node will definitely outperform php in terms of consumed resources, which in the end can also affect performance.

X
xmoonlight, 2020-05-09
@xmoonlight

Does nodejs outperform php in a typical site?
of course this is the wrong question. It all depends on how the code is implemented.
According to tests of primitive calculations and operations: node.js is much weaker than php.
In particular, IM on laravel/yii, even when using caching, shows a delay of 200-300ms.
Shikoko-shikoko?!!!
My php-framework on a matchbox does it in 5-7ms maximum!
Understand that the point is not in the language and not in the framework, but in the logic of the architectural algorithm .
Come to my blog - there I started a topic on architecture!

P
Pavel, 2020-05-14
@Pahus

https://thinkmobiles.com/blog/php-vs-nodejs/ here's a comparison for you, don't think that php loses a lot.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question