This is also handy when using socat to pipe across a network. You can use pv on both ends, one looking at compressed and the other looking at uncompressed data, in order to observe the real-time compression ratio.
tar c foo | pv | gzip | socat - tcp-listen:9999
socat tcp:bar:9999 - | pv > foo.tar.gz
If pv shows that you aren’t saturating your network and are cpu limited, replace gzip with lzop. If vice versa, replace gzip with something more aggressive.
tar c foo | pv | gzip | socat - tcp-listen:9999
socat tcp:bar:9999 - | pv > foo.tar.gz
If pv shows that you aren’t saturating your network and are cpu limited, replace gzip with lzop. If vice versa, replace gzip with something more aggressive.