As others have pointed out, the point of zswap is to "swap" in and out of RAM.
I'd like to add that your premise is faulty anyway: since compressed objects are smaller doing I/O on them is faster. As long as cost of the I/O you saved is less than the cost of doing the compression, it's faster not slower. Transparently compressed I/O usually uses high-speed algorithms (LZ4, LZO, etc) to take advantage of this effect.
Also, when a machine is swapping you'll usually find that the CPU is near idle since useful work is blocked on the swap I/O. Spending a little CPU time to speed up that I/O is a win.
It's not the cost of the storage, it's how slow it to read and write to it. This is still going to be an order of magnitude faster than swapping to disk.
The downvotes have already spoken to this to some extent, but who cares? My Macbook Pro is slow enough in general running OS X, and especially so when RAM gets tight. I'm not sure I'd want to add this additional overhead.
I see this more as an additional tool in the box than something appropriate for 100% of Linux users. You'll know when you need it, but most probably won't.
It seems that people mistook the "tone" of my post.
I didn't post it in an attempt to say that OS X is somehow superior, I just thought that people might find it interesting that this is the same feature that was shown in the last WWDC keynote -- and now Linux has it too!
(I'm not a Mac user, by the way.)
> My Macbook Pro is slow enough in general running OS X, and especially so when RAM gets tight. I'm not sure I'd want to add this additional overhead.
The point of this is that it makes things /faster/, not /slower/. It's essentially trading 1GB of DDR3 for 3GB of DDR1, which is a net gain when your ram amount is more of a bottleneck than ram speed (which it pretty much always is, IME)
I thought we were talking about compressing swap space? That's not really DDR-anything, it's slow-as-a-dog, last resort type stuff. Depending on the compression algorithm, compression level, and a number of other factors, this could be worse for some usage cases.
I'm skeptical that this is a big win in the case of Linux OR Mac OS, given that you want to avoid heavy swap usage to begin with. Especially as cheap as RAM is...
By the way, I recently discovered that you could use it in Ubuntu since 2012 (12.04).
Just `apt-get install zram-config` and reboot, voilá.
I'm using it both on my laptop and desktop at work with 4Gb physical RAM. I have PyCharm and lots of tabs open in Chrome and it has to reach around ~2gb of compressed swap before it hits the disk. It doesn't even seem to slow down the machine in any noticeable way.