From 012e045837fb79bcb80c1fb5982d901b4b50a212 Mon Sep 17 00:00:00 2001 From: pawel Date: Wed, 29 May 2019 16:47:13 -0700 Subject: [PATCH] make get_mtime_and_size use single stat call for files --- dvc/utils/fs.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dvc/utils/fs.py b/dvc/utils/fs.py index cecc0a207..9a7bd9e73 100644 --- a/dvc/utils/fs.py +++ b/dvc/utils/fs.py @@ -21,8 +21,9 @@ def get_inode(path): def get_mtime_and_size(path): - size = os.path.getsize(path) - mtime = os.path.getmtime(path) + stat = os.stat(path) + size = stat.st_size + mtime = stat.st_mtime if os.path.isdir(path): for root, dirs, files in dvc_walk(str(path)):