[Nottingham] 1GB of \0 (aka null)

Martin martin at ml1.co.uk
Mon Mar 27 15:06:27 BST 2006


Duncan John Fyfe wrote:
[---]
> Not shorter, but faster:
> 	dd if=/dev/zero count=131072 bs=8192 | sha1sum

Interesting...

On my machine:

[martin at muse06 ~ :)]$ time dd if=/dev/zero count=2M | sha1sum
2097152+0 records in
2097152+0 records out
1.92user 6.36system 0:41.88elapsed 19%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+186minor)pagefaults 0swaps
2a492f15396a6768bcbca016993f4b4c8b0b5307  -
[martin at muse06 ~ :)]$
[martin at muse06 ~ :)]$ time dd if=/dev/zero count=131072 bs=8192 | sha1sum
131072+0 records in
131072+0 records out
0.09user 0.97system 0:21.93elapsed 4%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+185minor)pagefaults 0swaps
2a492f15396a6768bcbca016993f4b4c8b0b5307  -
[martin at muse06 ~ :)]$
[martin at muse06 ~ :)]$ time dd if=/dev/zero bs=1M count=1k | sha1sum
1024+0 records in
1024+0 records out
0.00user 1.28system 0:37.58elapsed 3%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+184minor)pagefaults 0swaps
2a492f15396a6768bcbca016993f4b4c8b0b5307  -


So:

0.09 user 0.97 system 0:21.93 elapsed 4% CPU for Duncan.

1.92 user 6.36 system 0:41.88 elapsed 19% CPU and
0.00 user 1.28 system 0:37.58 elapsed 3% CPU

for my two attempts.


OK: Why?

Cheers,
Martin

-- 
----------------
Martin Lomas
martin at ml1.co.uk
----------------



More information about the Nottingham mailing list