Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

Benchmarks

lhofhansl edited this page Jan 6, 2011 · 3 revisions

Unscientific(!) benchmarks:

Thinkpad T500, 3GB, core duo 2 2.4GHz. node.js 0.2.5.

The Java heap was limited to 64MB for this test (supplying more heap space had no measurable effect).

Minimal http/1.1 server (using low level network module):

  var net = require('net');
  var server = net.createServer(function (stream) {
        stream.setEncoding('UTF-8');
        stream.on('connect', function () {});
        stream.on('data', function (data) {
                //if(data.match("\r\n\r\n$"))
                    stream.write('HTTP/1.0 200 OK\r\nConnection: Keep-Alive\r\nContent-Type: text/html\r\nContent-Length: 12\r\n\r\nHello World\n\r\n');
            });
        stream.on('end', function () {stream.end();});
    });
server.listen(8000, 'localhost');

Tested with: ab -k -c 100 -n 100000 http://localhost:8000/

RhiNode: 61500/sec

node.js: 25330/sec

Minimal http/1.0 server (using low level network module):

var net = require('net');
var server = net.createServer(function (stream) {
        stream.setEncoding('UTF-8');
        stream.on('connect', function () {});
        stream.on('data', function (data) {
                //if(data.match("\r\n\r\n$"))
                    stream.end('HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nContent-Length: 12\r\n\r\nHello World\n\r\n');
            });
        stream.on('end', function () {stream.end();});
    });
server.listen(8000, 'localhost');

Tested with: ab -c 100 -n 100000 http://localhost:8000/

RhiNode: 18150/sec

node.js: 9160/sec

The low level networking is probably as fast as one can get using the JVM and about twice as fast as node.js.

Clone this wiki locally