Linux/Compression tools: Difference between revisions
< Linux
No edit summary |
No edit summary |
||
Line 24: | Line 24: | ||
<blockquote> | <blockquote> | ||
<pre> | <pre> | ||
#!/bin/bash | |||
COMPRESSCMD="pigz -9" | |||
DESC="pigz-best" | |||
START=$(date +%s.%N) | |||
cat image.img | $COMPRESSCMD > /backup/$DESC.img.gz | |||
END=$(date +%s.%N) | |||
DIFF=$(echo "$END - $START" | bc) | |||
echo "$DIFF" > /backup/$DESC.log | |||
</pre> | </pre> | ||
</blockquote> | </blockquote> |
Revision as of 11:29, 18 November 2012
benchmark
- Compressing 6144MB kvm image
Command | Arguments | compressed size | time |
---|---|---|---|
pigz | --best | 1526M | 259.65s |
pigz | --fast | 1667M | 28.06s |
- benchmark script
#!/bin/bash COMPRESSCMD="pigz -9" DESC="pigz-best" START=$(date +%s.%N) cat image.img | $COMPRESSCMD > /backup/$DESC.img.gz END=$(date +%s.%N) DIFF=$(echo "$END - $START" | bc) echo "$DIFF" > /backup/$DESC.log