Skip to content

Instantly share code, notes, and snippets.

@LaurentVB
LaurentVB / bench.js
Created December 5, 2014 10:54
A naive port of joyent/http-parser bench.c to javascript, in order to test the performance of creationix/http-parser-js
var HTTPParser = require('./http-parser.js').HTTPParser;
var data = "GET /joyent/http-parser HTTP/1.1\r\n" +
"Host: github.com\r\n" +
"DNT: 1\r\n" +
"Accept-Encoding: gzip, deflate, sdch\r\n" +
"Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4\r\n" +
"User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) " +
"AppleWebKit/537.36 (KHTML, like Gecko) " +
"Chrome/39.0.2171.65 Safari/537.36\r\n" +