node js is faster then php

In present world usage of node js increasing fastly. now java script is very powerfull and can do all thing that a high level language can do.
We are working on php from last 10 years and of course we will continue work on it. but recently i compared the performace between node js and php. We are using redis server for caching and for postgres for db.

I created two api calls in php and nodejs, both are accessing same database table and performing the same type of task.
When i executes the both apis calls through postman (postman is a chrome extension used to check api.). I was shocked to see the results. node js was faster then php, php took 542 ms and nodejs took 181 ms to fetch the result. this number will not be same all the time, but overal node js is faster then php.

In node js you can write your own server response and there are thousands of modules available which can do all type of operations in nodejs, you can do almost everything in nodejs.

If you are only creating apis then you should use nodejs, php is not right choice for you. becuase it is slower. if you are a expert in javascript then you should obiviouly use node js for building your apis.

Leave a Reply

Your email address will not be published. Required fields are marked *

seventeen − fourteen =