Update benchmark, remove --harmony flag and use arrow functions

closes #567

Fix benchmark middleware - in promises body is on ctx not on this
master
Slobodan Stojanovic 2015-10-28 20:35:44 +01:00 committed by jongleberry
parent ae9edb6dc9
commit 6d3b81fe50
2 changed files with 3 additions and 9 deletions

View File

@ -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);

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
echo
MW=$1 node --harmony $2 &
MW=$1 node $2 &
pid=$!
sleep 2