File I/O improvements

- Tracer now iterates over blocks in disk order.
- Packer copies files per directory, in a separate thread.
- Packer only copies files if they don't exist yet.
- Packer also copies file permissions.
This commit is contained in:
Sybren A. Stüvel
2018-03-08 12:33:15 +01:00
parent b5418e1f5f
commit 08f538d8c8
3 changed files with 96 additions and 14 deletions
+5 -1
View File
@@ -24,7 +24,11 @@ def deps(bfilepath: pathlib.Path) -> typing.Iterator[result.BlockUsage]:
"""
bfile = blendfile.open_cached(bfilepath)
for block in asset_holding_blocks(file2blocks.iter_blocks(bfile)):
# Sort the asset-holding blocks so that we can iterate over them
# in disk order, which is slightly faster than random order.
ahb = asset_holding_blocks(file2blocks.iter_blocks(bfile))
for block in sorted(ahb):
yield from blocks2assets.iter_assets(block)