Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Trading cpu for bandwidth, so optimize for what you want.


Decompression is usually cheaper (CPU-wise) than compression so technically you’re trading their CPU for less of your bandwidth and CPU.

If you do it right you can even keep the content stored compressed without re-compressing by saving the compressed byte stream directly.


Also use pigz instead of gzip so it can use multiple threads on decoding (although you're probably Limited by sending bandwidth)


pigz doesn't help much with decompression:

https://github.com/madler/pigz/issues/36#issuecomment-249041...

Decompression can’t be parallelized, at least not without specially prepared deflate streams for that purpose. As a result, pigz uses a single thread (the main thread) for decompression, but will create three other threads for reading, writing, and check calculation, which can speed up decompression under some circumstances.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: