I posted this in a comment on the WordPress Hosting FB group in a discussion about whether gzipping a sql file for transport was worth it. I thought it an interesting comparison.
This is on an NVMe disk on a 32 core server with a light load.
$ time wp db export test.sql
real 0m3.410s
user 0m2.568s
sys 0m0.431s
176M test.sql
$ time wp db export - | gzip > file.sql.gz
real 0m8.304s
user 0m10.010s
sys 0m0.439s
40M file.sql.gz
$ time wp db export - | gzip --fast > fast.sql.gz
real 0m4.196s
user 0m5.728s
sys 0m0.340s
49M fast.sql.gz
The clear winner is gzip --fast. Only 23% slower in speed, but 73% reduction
in file size, vs normal's 240% decrease in speed but 88% reduction in file
size. 15% smaller file at 240% increased backup time is not worth it.
That's true, it does. And on a very fast connection, it's cheaper to leave it uncompressed. And true, I didn't factor in decompression. The context was specifically the speed of backups rather than the speed of restores.