architect / functions

AWS Lambda Node runtime helpers for Architect apps
https://arc.codes
163 stars 38 forks source link

Add option to enable/disable brotli compression #543

Closed macdonst closed 1 year ago

macdonst commented 1 year ago

The call to brotliCompressSync in src/http/_res-fmt.js adds a large overhead to the response time from the lambda.

11 of 12ms on 12kb or 91% 2.28 of 2.41s on 1.8mb or 94%

Describe the solution you'd like

It would be nice to have a way of opting out of the compression. Perhaps and option passed into arc.http() and arc.http.async()

Describe alternatives you've considered

I dug into alternative brotli compression libraries but the one we are using is the fastest.

https://github.com/timotejroiko/zlib-benchmark