Hacker News new | past | comments | ask | show | jobs | submit login

Memory compression? I can't find any good resources to read about it, any hints? I'm having trouble imaging how could it possibly work without totally destroying performance.



It doesn't destroy performance for the simple reason that nowadays memory access is slower than pure compute. If you need to use compute to produce some data to be stored in memory, your overall throughput could very well be faster than without compression.

There have been a large amount of innovation on fast compression and fast decompression in recent years. Traditional compression tools like gzip or xz are geared towards higher compression ratio, but memory compression tends to favor speed. Check out those algorithms:

* lz4: https://lz4.github.io/lz4/

* Google's snappy: https://github.com/google/snappy

* Facebook's zstd in fast mode: http://facebook.github.io/zstd/#benchmarks


On Mac, you can find Compressed memory in Activity monitor.

It’s something similar to swap - apps do not need to have built in support for it.


It segments a certain amount of ram to “swap” to which means compress and store. Normal blue sky ram operations are not compressed on macOS


Many operations are actually a lot faster with compressed memory than without. It's all about where the bottleneck is.


Oh, yes compressed swap makes much more sense, thanks.


It is not compressed swap, the compressed data is still in RAM. The OS just compresses inactive memory, with a couple of criteria to define “inactive”.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: