The problem with swapping isn't throughput (which compression could help
IF you had enough CPU horsepower, which you don't), but access time, which
compression will always hurt. So, compressing pages before swapping them
to disk will decrease performance.
However, an i486-66 with gzip can compress at the same speed as it can read/
write random pages on a moderately quick disk (12ms); and can decompress
significantly faster.
So, with some memory access patterns, on most hardware (486-DX2 or
faster with a contemporary drive; or a slower system + older drive),
assuming you can achieve the right balance between "swap" memory usage
and page cache, you could achieve a performance increase by compressing
pages in-core.
-- You too can commit two felonies by using this .sig: Eat bite fuck suck gobble nibble chew; nipple bosum hairpie finger-fuck screw moose-piss cat-pud orangutan-tit; sheep-pussy camel-crack pig-a-lie-in-shit