REST API: nodejs vs python

I want to make a Restful API for the current PHP application with the mongodb firewall database.

NodeJS (express) vs Python (web.py), which is better for performance?

+4
source share
1 answer

So, I found an article about speed checking . He wrote Russian so that you could not read it. But you can see the sample code.

Here are simple test results and a short translation of the explanation:

Python, Tornado

ab -n 10 -c 10 http://127.0.0.1:8888/ Time taken for tests: 20.078 seconds 

nodeJS

 ab -n 10 -c 10 http://127.0.0.1:8000/ Time taken for tests: 2.007 seconds 

There is no description of the test machine, but it is not so important.

The reason nodejs is faster is because it uses a non-blocking event loop, while python time.sleep blocks.

Yes?

+3
source

All Articles