Skip to content

Commit

Permalink
checkout: reduce makedirs call by caching (#561)
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry authored Aug 19, 2024
1 parent 7d4591f commit af8cd83
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/dvc_data/hashfile/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,16 @@ def __init__(
):
self._links = links
self._callback = callback
self._created_dirs: set[str] = set()

def __call__(
self, cache: "HashFileDB", from_path: str, to_fs: "FileSystem", to_path: str
):
parent = to_fs.parent(to_path)
to_fs.makedirs(parent)
if parent not in self._created_dirs:
to_fs.makedirs(parent)
self._created_dirs.add(parent)

try:
transfer(
cache.fs,
Expand Down

0 comments on commit af8cd83

Please sign in to comment.