h3-compression is very slow
Hello
We use your package in production. We still have some latency with page cache, like 400ms in local. We discovered that it was because of the compression method recommended in your wiki. By default, h3-compression uses the maximum quality parameter for brotli compression, resulting in decent compression but very very slow. We reimplemented by hand the compression, and we manage to get 20ms brotli compression. So 20ms * 10ms with page cache instead of 400+.
You shouldn't recommend using this package in your wiki.
I have forked the repo, you can use it as it is: https://github.com/TimGonnet/h3-fast-compression?tab=readme-ov-file#benchmarks
Or recommend this code: https://github.com/TimGonnet/h3-fast-compression/blob/e94f9b2bfd0e0790fb19afd83e05aa9350f01f91/src/helper.ts#L38C1-L67C2
Thank you for bringing this to my attention. Personally I don't use any compression at this level but instead handle it via nginx or varnish.
I originally added it to the docs because there was a bug report that route cache + compression doesn't work. Looking at your benchmarks the differences are quite huge, so I will gladly link to your version! I will also add a test case in the module to make sure it also works with your module.
Added this in the docs, in addition to writing a test case using this library.