diff --git a/benchmarks/middleware.js b/benchmarks/middleware.js index d23755a..401d244 100644 --- a/benchmarks/middleware.js +++ b/benchmarks/middleware.js @@ -11,17 +11,11 @@ let n = parseInt(process.env.MW || '1', 10); console.log(` ${n} middleware`); while (n--) { - app.use(function(ctx, next){ - return next(); - }); + app.use((ctx, next) => next()); } const body = new Buffer('Hello World'); -app.use(function(ctx, next){ - return next().then(function(){ - this.body = body; - }); -}); +app.use((ctx, next) => next().then(() => ctx.body = body)); app.listen(3333); diff --git a/benchmarks/run b/benchmarks/run index f627ae9..93b5bc5 100755 --- a/benchmarks/run +++ b/benchmarks/run @@ -1,7 +1,7 @@ #!/usr/bin/env bash echo -MW=$1 node --harmony $2 & +MW=$1 node $2 & pid=$! sleep 2