5 ms·
This isn't a fair comparison. the "HTTP server" presented isn't doing any checks / validation that a typical web server does. Compare https://github.com/Magic
by halayli 10y ago
This isn't a fair comparison. the "HTTP server" presented isn't doing any checks / validation that a typical web server does.
Compare
https://github.com/MagicStack/vmbench/blob/master/servers/asyncio_http_server.py https://github.com/MagicStack/vmbench/blob/master/servers/as...
to
https://github.com/nodejs/node/blob/master/lib/_http_outgoing.js https://github.com/nodejs/node/blob/master/lib/_http_outgoin...
https://github.com/nodejs/node/blob/master/lib/_http_server.js https://github.com/nodejs/node/blob/master/lib/_http_server....
https://github.com/golang/go/blob/master/src/net/http/server.go https://github.com/golang/go/blob/master/src/net/http/server...
The benchmark is almost equivalent to testing raw eventloop performance against a complete http server.
To make this test fair, you need to write the same code in asyncio_http_server.py in other languages.
- felixweis 10y agoThere is a TCP and a HTTP benchmark.
- RedCrowbar 10y ago> This isn't a fair comparison. the "HTTP server" presented isn't doing any checks / validation that a typical web server does. How so? It uses a binding to http-parser, just like nodejs.
- halayli 10y agoParsing is just a small part of an http server. You can check the links I posted to see how much work is involved in validating http headers (after parsing), and creating http responses.
- 1st1 10y agoKeep in mind that the HTTP server in the benchmarks actually uses the httptools parser, which is a full-blown HTTP parser. A lot of heavy-lifting is done by the parser. I plan to add a complete HTTP protocol implementation to httptools, but honestly, I don't expect it to be more than 20% slower.