Skip to content

Instantly share code, notes, and snippets.

View ceelsoin's full-sized avatar
🏠
Working from home

Celso Inácio ceelsoin

🏠
Working from home
View GitHub Profile
@billywhizz
billywhizz / bench.js
Created February 14, 2012 23:50
node.js static file serving benchmark
var TCP = process.binding("tcp_wrap").TCP;
var Buffer = process.binding("buffer").SlowBuffer;
var HTTPParser = process.binding("http_parser").HTTPParser;
function setupSocket(peer) {
function shutdownHandler(status, handle, req) {
// TODO: ensure we only shutdown once
if(status != 0) {
if(peer.onerror) {
var err = new Error("shutdown");