Benjamin Woodruff
a5afb36765
Fix O(n^2) time bug in --delay-directory-restore
...
delayed_set_stat avoids inserting duplicate entries into
delayed_set_stat_head. It was doing this by scanning the entire
list.
Normally this list is small, but if --delay-directory-restore is
used (including automatically for incremental archives), this list
grows with the total number of directories in the archive.
The entire scan takes O(n) time. Extracting an archive with n
directories could therefore take O(n^2) time.
The included test uses AT_SKIP_LARGE_FILES, allowing it to optionally be
skipped. It may execute slowly on certain filesystems or disks, as it
creates thousands of directories.
There are still potentially problematic O(n) scans in
find_direct_ancestor and remove_delayed_set_stat, which this patch does
not attempt to fix.
* NEWS: Update.
* src/extract.c (delayed_set_stat_table): Create a table for O(1)
lookups of entries in the delayed_set_stat_head list. The list
remains, as tracking insertion order is important.
(dl_hash, dl_compare): New hash table helper functions.
(delay_set_stat): Create the hash table, replace the O(n) list scan
with a hash_lookup, insert new entries into the hash table.
(remove_delayed_set_stat): Also remove entry from hash table.
(apply_nonancestor_delayed_set_stat): Also remove entry from hash
table.
(extract_finish): Free the (empty) hash table.
* tests/extrac26.at: New file.
* tests/Makefile.am (TESTSUITE_AT): Include extrac26.at.
* tests/testsuite.at: Include extrac26.at.
2023-08-21 13:42:14 -07:00
..
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2018-04-07 10:32:38 +03:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-07-18 09:57:24 -07:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-08-15 11:34:21 +03:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-04-18 10:50:57 +03:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-08-21 13:42:14 -07:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-08-21 13:42:14 -07:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-07-10 12:33:34 +03:00
2023-07-10 12:33:34 +03:00
2023-07-10 12:33:34 +03:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-08-21 13:42:14 -07:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-07-10 21:25:30 +03:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00
2023-01-06 12:50:36 -08:00