[PERF] Time-to-pack Increases Proportional to File Count Rather than Backup Size #41

Closed
opened 2023-12-20 13:45:57 +00:00 by ZAdamMac · 1 comment
ZAdamMac commented 2023-12-20 13:45:57 +00:00 (Migrated from github.com)

Describe the bug
The first two steps of the backup construction process (The "sorting" step and the actual "packing" step) scale in time-to-complete based strongly on the number of items included in the backup, with the overall file size playing a relatively small role in the time spent on these steps. The RIFF file size also scales virtually linearly based on file count alone with file size playing only the smallest influence on the RIFF output file's size.

To Reproduce
Steps to reproduce the behavior:

  1. Run an --inc or unflagged backup against a data set containing 10s of the 1000s of files.

Expected behavior
As much as possible the main constraint in Tapestry's run time should be the amount of data being backed up, rather than the individual number of small files. This is especially of concerned when used by users who generate a very large number of relatively small files; such users to include many FOSS advocates who doubtless have many locally cloned repos which may or may not be included in their backup paths.

Log/Console Output
Where possible, add the output of the Logs or Console when the problem occurs.

Program completes as normal, console output does not include runtime.

Desktop (please complete the following information):

  • OS: Ubuntu 23.04.1
  • Python 3.10.12
  • Version 2.2.2

Additional context
Add any other context about the problem here.

This became especially evident when working with a backup tree that included the qmk source code. The qmk source code contained well over 50,000 individual files which collectively made up roughly 93% of all files included in the backup run. Simply tarring the directory containing the qmk source code and removing the unpacked version of the repo from the path of the backup reduced backup times from tens of hours to 24 minutes, without changing anything about Tapestry itself or the hardware it was run on. This only changed the final output file size for the .tap files by roughly the size of a compact disk; it did however reduce the RIFF file sizes by over 75%

**Describe the bug** The first two steps of the backup construction process (The "sorting" step and the actual "packing" step) scale in time-to-complete based strongly on the number of items included in the backup, with the overall file size playing a relatively small role in the time spent on these steps. The RIFF file size also scales virtually linearly based on file count alone with file size playing only the smallest influence on the RIFF output file's size. **To Reproduce** Steps to reproduce the behavior: 1. Run an `--inc` or unflagged backup against a data set containing 10s of the 1000s of files. **Expected behavior** As much as possible the main constraint in Tapestry's run time should be the amount of data being backed up, rather than the individual number of small files. This is especially of concerned when used by users who generate a very large number of relatively small files; such users to include many FOSS advocates who doubtless have many locally cloned repos which may or may not be included in their backup paths. **Log/Console Output** Where possible, add the output of the Logs or Console when the problem occurs. > Program completes as normal, console output does not include runtime. **Desktop (please complete the following information):** - OS: Ubuntu 23.04.1 - Python 3.10.12 - Version 2.2.2 **Additional context** Add any other context about the problem here. This became especially evident when working with a backup tree that included the qmk source code. The qmk source code contained well over 50,000 individual files which collectively made up roughly 93% of all files included in the backup run. Simply tarring the directory containing the qmk source code and removing the unpacked version of the repo from the path of the backup reduced backup times from tens of hours to 24 minutes, without changing anything about Tapestry itself or the hardware it was run on. This only changed the final output file size for the .tap files by roughly the size of a compact disk; it did however reduce the RIFF file sizes by over 75%
ZAdamMac commented 2024-01-04 13:19:25 +00:00 (Migrated from github.com)

This issue is fundamentally being caused by the tarbuild process evidenced in windows_pack_blocks and unix_pack_blocks, and is reproducable on both systems.

The solution to this issue long-term is a change to how blocks are packed, to have them work more like compression - one child process working on one block at a time.

However, this is a heavy lift for an issue with a known workaround, and one that only occurs in relatively extreme cases, which no user other than me has reportedly encountered.

Since there are no other known users of Tapestry, and I am satisfied with the workaround, and given the impending sunset of Tapestry as a tool used by Arcana Labs, I will not be taking action to address this issue.

This issue is fundamentally being caused by the tarbuild process evidenced in `windows_pack_blocks` and `unix_pack_blocks`, and is reproducable on both systems. The solution to this issue long-term is a change to how blocks are packed, to have them work more like compression - one child process working on one block at a time. However, this is a heavy lift for an issue with a known workaround, and one that only occurs in relatively extreme cases, which no user other than me has reportedly encountered. Since there are no other known users of Tapestry, and I am satisfied with the workaround, and given the impending *sunset* of Tapestry as a tool used by Arcana Labs, I will not be taking action to address this issue.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zadammac/Tapestry#41
No description provided.