From 80a2a4113f04cbea3b9544eb40857183838c80ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Borgstr=C3=B6m?= Date: Tue, 3 Jun 2014 21:39:26 +0200 Subject: [PATCH] Revert "Reduce memory usage when backing up many small files" The memory usage should be reduced a fair bit by #90 so this might not be needed anymore. Or at least not enabled by default --- CHANGES | 1 - attic/cache.py | 17 ++++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index da4e5417e..c86c0afd7 100644 --- a/CHANGES +++ b/CHANGES @@ -10,7 +10,6 @@ Version 0.13 - Reduce file cache memory usage (#90) - Faster AES encryption (utilizing AES-NI when available) -- Reduced memory usage when backing up many small files (#69) - Experimental Linux, OS X and FreeBSD ACL support (#66) - Added support for backup and restore of BSDFlags (OSX, FreeBSD) (#56) - Fix bug where xattrs on symlinks were not correctly restored diff --git a/attic/cache.py b/attic/cache.py index 515dfc9ba..7146c4f3c 100644 --- a/attic/cache.py +++ b/attic/cache.py @@ -12,9 +12,6 @@ from .hashindex import ChunkIndex class Cache(object): """Client Side cache """ - # Do not cache file metadata for files smaller than this - FILE_MIN_SIZE = 4096 - class RepositoryReplay(Error): """Cache is newer than repository, refusing to continue""" @@ -84,9 +81,8 @@ class Cache(object): break u.feed(data) for path_hash, item in u: - if item[2] > self.FILE_MIN_SIZE: - item[0] += 1 - self.files[path_hash] = msgpack.packb(item) + item[0] += 1 + self.files[path_hash] = msgpack.packb(item) def begin_txn(self): # Initialize transaction snapshot @@ -223,8 +219,7 @@ class Cache(object): return None def memorize_file(self, path_hash, st, ids): - if st.st_size > self.FILE_MIN_SIZE: - # Entry: Age, inode, size, mtime, chunk ids - mtime_ns = st_mtime_ns(st) - self.files[path_hash] = msgpack.packb((0, st.st_ino, st.st_size, mtime_ns, ids)) - self._newest_mtime = max(self._newest_mtime, mtime_ns) + # Entry: Age, inode, size, mtime, chunk ids + mtime_ns = st_mtime_ns(st) + self.files[path_hash] = msgpack.packb((0, st.st_ino, st.st_size, mtime_ns, ids)) + self._newest_mtime = max(self._newest_mtime, mtime_ns)