opencomponents / oc

OpenComponents, serverless in the front-end world for painless micro-frontends delivery
https://opencomponents.github.io/
MIT License
1.42k stars 122 forks source link

compress compiled client #1375

Closed ricardo-devis-agullo closed 1 week ago

ricardo-devis-agullo commented 1 week ago

This compresses and caches the compiled oc-client, to serve as fast possible. I'm only compressing oc-client and caching it, since the other routes don't make as much sense to do, an it gives a boost in performance in comparison of just using app.use(compress()) on the express instance.

Using compress library

Stat 2.5% 50% 97.5% 99% Avg Stdev Max
Latency 102 ms 119 ms 129 ms 131 ms 119.94 ms 46.47 ms 2929 ms
Stat 1% 2.5% 50% 97.5% Avg Stdev Min
Req/Sec 7,163 7,163 8,359 8,495 8,292.71 231.73 7,163
Bytes/Sec 67.1 MB 67.1 MB 78.3 MB 79.6 MB 77.7 MB 2.17 MB 67.1 MB

Optimized Compression

Stat 2.5% 50% 97.5% 99% Avg Stdev Max
Latency 93 ms 106 ms 121 ms 123 ms 107.56 ms 25.97 ms 1913 ms
Stat 1% 2.5% 50% 97.5% Avg Stdev Min
Req/Sec 8,319 8,319 9,255 9,447 9,243 183.74 8,319
Bytes/Sec 77.8 MB 77.8 MB 86.5 MB 88.3 MB 86.4 MB 1.71 MB 77.7 MB