Update benchmark, remove --harmony flag and use arrow functions
closes #567 Fix benchmark middleware - in promises body is on ctx not on this
This commit is contained in:
parent
ae9edb6dc9
commit
6d3b81fe50
2 changed files with 3 additions and 9 deletions
|
@ -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);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
echo
|
||||
MW=$1 node --harmony $2 &
|
||||
MW=$1 node $2 &
|
||||
pid=$!
|
||||
|
||||
sleep 2
|
||||
|
|
Loading…
Reference in a new issue