-
Notifications
You must be signed in to change notification settings - Fork 0
More Benchmarks
http server using the http module (includes header parsing, chunking, etc).
var http = require('http')
s = http.createServer(function(req,res) {
res.writeHead(200,{'Content-Type':'text/plain'})
res.end('Hello World\n')
});
s.listen(8000, "localhost");
console.log('Running at http://127.0.0.1:8000/')
ab -k -c 100 -n 100000 http://localhost:8000/
RhiNode: 13100/sec
node.js: 6930/sec (node.js does not recognize keep-alive if the protocol version is 1.0)
ab -c 100 -n 100000 http://localhost:8000/
Rhinode: 6710/sec
node.js: 7100/sec
Same with content-length specified (instead of chunking):
var http = require('http')
s = http.createServer(function(req,res) {
res.writeHead(200,{'Content-Type':'text/plain','Content-length':'12'})
res.end('Hello World\n')
});
s.listen(8000, "localhost");
console.log('Running at http://127.0.0.1:8000/')
ab -k -c 100 -n 100000 http://localhost:8000/
RhiNode: 14100/sec
node.js: 16860/sec
ab -c 100 -n 100000 http://localhost:8000/
Rhinode: 6630/sec
node.js: 7100/sec
Rhinode's HTTP module is written in plain Javascript as a clean client to the NET module. Implementing more shortcuts and moving logic to Java (like node.js does with C++) it should be possible to get this close to the native speed of the NET module.