Re:Uvloop: Fast Python networking
by cjbprime on Tuesday May 03, 2016 @11:28PM
(#11625957)
Wow. What's the intuition for why python on top of libuv is 2x faster than node on top of libuv?
[ Parent
| on HN ]
Two things I'd check first:
1. The benchmarks make servers generate a huge number of objects, so maybe, the GC is under too much pressure.
2. Another possibility is that the v8 JIT can't optimize some JS code in nodejs, or does a poor job.
That said, only careful profiling can answer your question :)
Re:Uvloop: Fast Python networking
by geekuillaume on Wednesday May 04, 2016 @12:41AM
(#11626241)
I would be interested in seeing the performance difference in NodeJS TCP echo benchmark by using piping instead of reading/writing manually:
socket.pipe(socket);
Re:Uvloop: Fast Python networking
by occasionalreedr on Wednesday May 04, 2016 @05:18PM
(#11631924)
C Python uses ref counting, whereas Node/V8 uses GC. Ref counting schemes generally use much less memory and GC scans can be expensive when there's a lot of new data, as is the case for a web server.
Re:Uvloop: Fast Python networking
by fzaninotto on Wednesday May 04, 2016 @02:52AM
(#11626659)
How about clustering the Node server? By default, node uses only one process. Making the server use all available processes requires a bit more work (see https://nodejs.org/docs/latest/api/cluster.html or https://github.com/Unitech/pm2) but will probably do more justice to Node.js vs Python.