-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(backend): store files in binary as compressed #263
Conversation
No need to compress them during runtime, so smaller and faster binary
Do it in the Makefile
Brotli is only supported on https and localhost connections
Just for clarification:
Was there a cache for gzip-compressed assets before, so that this change does not actually enhance request performance but runtime memory usage instead? |
Yes, yes, and yes. The files are compressed before being included into the binary. From a quick glance, it doesn't look like there's a cache (https://github.com/seanmonstar/warp/blob/11169f2858f82cbac388771e91331c4d5e5ec070/src/filters/compression.rs#L70-L83), and to be sure, I ran a few benchmarks using the large
Obviously, the difference is basically negligible, however the current approach does seem to be better than the previous one. |
Affects anyway only first access of a client due to browser cache. But, despite the little larger binary, I agree it is better now, also reducing CPU utilisation a tiny little bit 🙂. |
No need to compress them during runtime, so smaller and faster binary.
Compressed with UPX, it's now actually slightly larger, because it's trying to recompress the already-compressed data, and because the text was LZMA compressed (in the binary) before.