]> git.ipfire.org Git - thirdparty/libarchive.git/commit
mtree: use hash table for duplicate entry search 819/head
authorAndrew Gregory <andrew.gregory.8@gmail.com>
Tue, 1 Nov 2016 16:42:14 +0000 (12:42 -0400)
committerAndrew Gregory <andrew.gregory.8@gmail.com>
Wed, 2 Nov 2016 00:40:26 +0000 (20:40 -0400)
commite1eeb7e3eb79caec1a85ab8e9fbc13034f09e182
tree0eda5039a464154334e3d9bc1574ec3bf71df2e4
parentdeb0596be52a2c28c0e6cc7590fda40a54273beb
mtree: use hash table for duplicate entry search

Because mtree combines multiple non-adjacent entries for the same file,
parse_file() has to compare every entry to every other entry.  For large
mtree files, this results in extremely long parse times.  By breaking
the entries down into a hash table, the number of comparisons required
can be drastically reduced.  The hash function was taken directly from
the standard user/group lookup code.
libarchive/archive_read_support_format_mtree.c