Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Other than the densification I would perform e.g.
=> It seems like you'd be better off using MTIME as a screen, and then if and only if MTIME is unchanged do further testing. Afterall, a stat is cheaper than a slurp and hash. As for the name I would think File::Modified might be more appropriate. UPDATE: Perhaps I should explain the logic behind determining if something is changed. Mtime in and of itself is not complete as one may touch a file node to it's initial setting after editing. Hence we try a different method to check for difference if the Mtime is not changed. If the Mtime is changed, we accept this. Although the inode may have been touched to affect this change, that is acceptable. On the whole this is not such a large performance boost (it only save you a hashing when Mtime is different) but it does (at least to me) present a more comprehensive system. Also if performance is of concern, or may be for the users, you may consider hashing only a portion of the file. Say the first 32K, or the first and last 16K, etc. since the Digest module reads the entire file into memory with the addfile method.
-- In reply to Re: File::Dependencies - a new module looking for a good name (and more discussion)
by belg4mit
|
|