Created
May 22, 2014 03:09
-
-
Save ashi009/294f125ade6f7a9e11cb to your computer and use it in GitHub Desktop.
express crc32 benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: | |
@./run 128 res-size | |
@./run 512 res-size | |
@./run 1024 res-size | |
@./run 2048 res-size | |
@./run 4096 res-size | |
@./run 16384 res-size | |
@./run 65536 res-size | |
@echo | |
.PHONY: all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var express = require('..'); | |
var app = express(); | |
// number of middleware | |
var n = parseInt(process.env.BUFFER_SIZE || '100', 10); | |
console.log(' response size: %sB', n); | |
var body = new Buffer(n); | |
app.use(function(req, res, next){ | |
res.send(body); | |
}); | |
app.listen(3333); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo | |
BUFFER_SIZE=$1 node $2 & | |
pid=$! | |
sleep 2 | |
wrk 'http://localhost:3333/' \ | |
-d 10 \ | |
-c 50 \ | |
-t 8 \ | |
| grep 'Requests/sec' \ | |
| awk '{ print " " $2 }' | |
kill $pid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment