Skip to content
Myr

add new benchmarks (to match koa)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by TJ Holowaychuk · committed by TJ Holowaychuk · parent a0c1ac7 · Browse files · 5 files+55 added−35 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+55 added−35 removed

  • other:+55 added−35 removed

5 files+55 added−35 removed

added:benchmarks/Makefile+13 added
12all:3 @./run 1 middleware4 @./run 5 middleware5 @./run 10 middleware6 @./run 15 middleware7 @./run 20 middleware8 @./run 30 middleware9 @./run 50 middleware10 @./run 100 middleware11 @echo1213.PHONY: all
added:benchmarks/middleware.js+23 added
added:benchmarks/run+16 added
1#!/usr/bin/env bash23echo4MW=$1 node --harmony-generators $2 &5pid=$!67sleep 289wrk 'http://localhost:3333/?foo[bar]=baz' \10 -d 3 \11 -c 50 \12 -t 4 \13 | grep 'Requests/sec' \14 | awk '{ print " " $2 }'1516kill $pid
deleted:support/bench-32 removed
1#!/usr/bin/env bash23NODE_ENV=production node ./support/app &4pid=$!56bench() {7 ab -n 5000 -c 50 -k -q http://127.0.0.1:8000$1 \8 | grep "Requests per" \9 | cut -d ' ' -f 7 \10 | xargs echo "$2:"11}1213bench_conditional() {14 ab -n 5000 -c 50 -H "If-None-Match: $3" -k -q http://127.0.0.1:8000$1 \15 | grep "Requests per" \16 | cut -d ' ' -f 7 \17 | xargs echo "$2:"18}1920sleep .521bench / "Hello World"22bench /blog "Mounted Hello World"23bench /blog/admin "Mounted 2 Hello World"24bench /middleware "Middleware"25bench /match "Router"26bench /render "Render"27bench /json "JSON tiny"28bench /json/15 "JSON small"29bench /json/50 "JSON medium"30bench /json/150 "JSON large"3132kill -9 $pid
modified:Makefile+3 added-3 removed
22 unmodified lines
2324lib-cov:25 @jscoverage lib lib-cov2627benchmark:28 @./support/bench27bench:28 @$(MAKE) -C benchmarks2930clean:31 rm -f coverage.html32 rm -fr lib-cov3334.PHONY: test test-unit test-acceptance benchmark clean34.PHONY: test test-unit test-acceptance bench clean