I want to make Restful API for current PHP application with mongodb backend database.
NodeJS (express) vs Python (web.py), which is better for performance?
So I found some speed test article. It's written in Russian so you may not able to read this. But you can look at the code for examples.
Here simple test results and short translation of explanation:
Python, Tornado
ab -n 10 -c 10 http://127.0.0.1:8888/
Time taken for tests: 20.078 seconds
Node.js
ab -n 10 -c 10 http://127.0.0.1:8000/
Time taken for tests: 2.007 seconds
There is no description of testing computer but it's not so matter.
The reason why Node.js is faster is that it uses nonblocking event loop while Python's time.sleep is blocking.
Since Python has received asyncio, the benchmarks from the article aren't complete without tests of asyncio.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With