Koa: Let me introduce how to improve performance easily.

Created on 17 Nov 2016  路  6Comments  路  Source: koajs/koa

koa's concept is really terrific.

I'm sure koa v2 + async/await will be the mainstream in the future.
but, I guess someone needs to use koa v1 for various reasons.

co-booster is a performance tuning version of co.
It's fully compatible with co. and, works fastly in many cases.

co is used in a core logic of koa v1 and koa-convert.
so, I believe it makes koa better without much effort.

Here are my results using koa's benchmark script. (100 middlewares)

- koa v1 + nodejs v4.4.7 : 11% better
- koa v1 + nodejs v6.9.1 : 13% better
- koa v2(legacy middleware) + nodejs v4.4.7 : 13% better
- koa v2(legacy middleware) + nodejs v6.9.1 : 14% better

I just wondered what author, contributors, and users think about.
I'd like to contribute to koa if I have a chance.

Most helpful comment

Look good, I think co-booster and co merge together will be good choice for the whole co solution.

All 6 comments

The numbers look good! Since co-booster is fully compatible with co however, what do you think about merging your changes into co instead?

Look good, I think co-booster and co merge together will be good choice for the whole co solution.

I agree to merging co-booster into co. It depends on the decision of co's maintainers. because it can be a module that is not mature yet.

I tried a lot to confirm about the compatibility and performance. but, I think it should be checked more thoroughly because co is used by many projects.

@ifsnow Thats awesome, great work! I'm sure the people over at co can help with testing and validating the performance. One way to start the discussion would be to open a PR there 馃憤

@marvinhagemeister I'm so flattered. opened a PR in co. I hope it will pay off.

yes, you can make PRs to co. koa just uses that library, so you'll have to push changes there.

however, long term, we are using native await, so i'm not really interested in improving performance with generators.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tracker1 picture tracker1  路  3Comments

koalex picture koalex  路  3Comments

ElegantScripting picture ElegantScripting  路  5Comments

rowild picture rowild  路  4Comments

edahlseng picture edahlseng  路  3Comments