pro:
* works with promise, generator function and es7 async function
* no promise chain, very little overhead, and low latency
* no intermediate lazy evaluated generator or wrapper
* JIT friendly (since you can use function instead of generator function for many use case)
* es6 tail calls friendly (althrough it's not implemented in v8 yet)

con:
* too many choices (promise, generator, async function) may be confusing
* nested function (fn ... return fn ... return) may looks confusing, could be a barrier for new developer.
* more typing and look more complex than previous two


This is a proposal to use promise-style middleware instead of generator-style middleware. It will decouple co from koa.

[async arrow function](https://tc39.github.io/ecmascript-asyncawait/#prod-AsyncArrowFunction)

This is more than performance gain. It could decouple co from koa and we are be able to choose just use Promise, or with co, or with bluebird.coroutine, or async funciton.

## migration

just change `yield next` to `yield next(context)` or `return yield next` to `return next(context)`

I know performance is dfficult to measure.

It's varies case by case.

I don't write real application with promised approach and cannot give how it gains from real case.
But when I got above
Result, I was shocked and I think it worth to explore further.

## performance

it's more than just wrapper. For common case where the middleware dost not have async operation.

There is one common case worth sharing.

| API | 1 | 25 | 50 | 75 | 100 |
|:---------|--:|---:|---:|---:|----:|
| [`return yield next`](https://github.com/gyson/koa-benchmarks/blob/02331a0f14b46206a6b722380d054454fabf5309/koa-next-as-wrapper/generator-yield.js) | 8593.41 | 5063.84 | 3331.32 | 2530.32 | 1995.63 |
| [`return next(context)`](https://github.com/gyson/koa-benchmarks/blob/02331a0f14b46206a6b722380d054454fabf5309/koa-next-as-function/function-return.js) | 10230.24 | 10046.31 | 9831.87 | 9728.75 | 9464.74 |

in `return yield next` case, it create wrapper, generator, co instance (a Promise and a few closure) and `.then` calls.

in `return next(context)`, it does not have above overhead.

I don’t kwon how it will affect real-world application. But above numbers indeed shock me for a while.
