Skip to content

Instantly share code, notes, and snippets.

@tj
Created June 10, 2011 16:08
Show Gist options
  • Save tj/1019167 to your computer and use it in GitHub Desktop.
Save tj/1019167 to your computer and use it in GitHub Desktop.
var app = express.createServer();
app.get('/hello', function(req, res){
res.send('Hi there!');
});
app.listen(3000);
// ab -n 8000 -c 40 http://local:3000/hello (no keep-alive)
// 4068.51 rps
var journey = require('../');
var router = new(journey.Router);
router.get('/hello').bind(function (req, res) { res.send('Hi there!') });
require('http').createServer(function (request, response) {
router.handle(request, '{}', function(res){
response.writeHead(200, res.headers);
response.end(res.body);
});
}).listen(3000);
// ab -n 8000 -c 40 http://local:3000/hello (no keep-alive)
// 3340.99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment