koajs / discussions

KoaJS Discussions
2 stars 2 forks source link

Brotli compress is slow #46

Closed oli1605 closed 3 years ago

oli1605 commented 4 years ago

I was just checking out my nodejs service with Brotli compression enabled with default config and Brotli enabled. Download size decreased from 77kb to 47kb with Brotli, but total request time raised from 209ms (waiting: 200ms + download: 9ms) to 1306ms (waiting 1300ms + download: 6ms) in Chrome DevTools. I read that latency might increase, but not at such a high level.

Tested with Chrome Dev85, NodeJS 12.18.1 + Koa 2.13 + Koa-Compress 4.0.1. I am working with JSON data.

jonathanong commented 4 years ago

i'm not surprised. feel free to disable it on ur app.

jonathanong commented 3 years ago

latest koa-compress defaults to lvl 4. hopefully this helps!