speeding up scripts by not gzipping stuff?
Hi,
The load on www-master.d.o often worries me. I run top ever now and then and
notice all those glimpses and search_*.pls, it's sickening :)
So I've wondered...
[joy@klecker:~/packages/contents/unstable]% time gunzip -c Contents-i386.gz >/dev/null
gunzip -c Contents-i386.gz > /dev/null 1.70s user 0.03s system 99% cpu 1.746 total
[joy@klecker:~/packages/contents/unstable]% time gunzip -c Contents-i386.gz >/dev/null
gunzip -c Contents-i386.gz > /dev/null 1.71s user 0.02s system 100% cpu 1.725 total
[joy@klecker:~/packages/contents/unstable]% zcat Contents-i386.gz > foo
[joy@klecker:~/packages/contents/unstable]% time grep sshd foo >/dev/null
grep sshd foo > /dev/null 0.21s user 0.56s system 102% cpu 0.753 total
[joy@klecker:~/packages/contents/unstable]% time grep sshd foo >/dev/null
grep sshd foo > /dev/null 0.22s user 0.15s system 100% cpu 0.368 total
[joy@klecker:~/packages/contents/unstable]% time grep sendmail foo >/dev/null
grep sendmail foo > /dev/null 0.11s user 0.17s system 100% cpu 0.278 total
[joy@klecker:~/packages/contents/unstable]% time grep ls foo >/dev/null
grep ls foo > /dev/null 0.48s user 0.23s system 86% cpu 0.825 total
So it seems we'd save quite a bit of time if we extracted the gzipped files.
[joy@klecker:~/packages/contents/unstable]% zcat `find . -name \*.gz` | wc -c | tail -1
608331648
[joy@klecker:~/packages/contents/unstable]% df `pwd -r` -h
Filesystem Size Used Avail Use% Mounted on
/dev/rd/c0d0p3 46G 26G 18G 59% /org
Would anyone mind if I unpacked those 580 MB and kept them that way?
--
2. That which causes joy or happiness.
Reply to: