Next | Twelve Talks in One | 6 |
Let's think about this a little more carefully
cmp requires a fork and an exec
Two opens
Then possibly reading both files and comparing them
The MD5 thing would require one open
Reading one file
Computing the checksum
MD5 benefit = open + fork + exec + file read
MD5 cost = calculate checksum
Guess what? Calculating a checksum is expensive
The MD5 thing was slower
More Details | Copyright © 2003 M. J. Dominus |