RKrahl/archive-tools

class FileInfo should calculate checksums lazily

Closed this issue · 0 comments

A FileInfo object is created either from data or from a file path. In the latter case, the file attributes are obtained from a stat() call and checksums of the file are calculated (in the case of a regular file). The calculation of the checksums is expensive as it requires reading the complete file. This should be postponed to the moment that this information is actually needed.

This may particularly speed up archive-tool check, because the checkums need only be compared for those files that are present in the archive. Currently the checksums of all files on the command line are calculated first, before even checking if they are in the archive.