Both ZRAM and ZSWAP work bad inside VirtualBox (or virtualizers generally?). Even with 4 CPUs assigned. That might be because CPU inside VM is ineffective? 100 % CPU usage inside the VM once but only ~ 30 % usage on the host. (Viewed using ksysguard.)
My other suggestion is to try zswap which might be more easy going on CPU since older memory pages can be swapped out unlike zram.
I think ZSWAP will always be slower since it uses the disk. Also I don’t think on a gui system is much stuff that should be swapped to disk? Perhaps when heavy multi tasking and some applications are not in use for a long time.
With 768 MB RAM however, only konsole, ksysguard and Tor Browser with ~ 5 tabs lead to ~ 6 seconds delay when switching applications. Not an endurable user experience.
Perhaps ZRAM / ZSWAP aren’t designed for GUI systems? Perhaps our use case (very low RAM plus very low CPU) is just hosed?
GitHub - nefelim4ag/systemd-swap: Script for creating hybrid swap space from zram swaps, swap files and swap partitions. is pretty easy to install and use if someone else likes to try.