From 409ab9f6123bb503f337cc828951e2a8ce549cc6 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 9 Jul 2016 14:36:09 +0200 Subject: [PATCH] fix/optimize initial hash table size for borg check initial size should be so that the hash table does not need resizing - it must always stay below the MAX_LOAD_FACTOR. --- borg/archive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/borg/archive.py b/borg/archive.py index 3cc9c2c22..f676a8473 100644 --- a/borg/archive.py +++ b/borg/archive.py @@ -826,7 +826,7 @@ def init_chunks(self): """ # Explicitly set the initial hash table capacity to avoid performance issues # due to hash table "resonance" - capacity = int(len(self.repository) * 1.2) + capacity = int(len(self.repository) * 1.35 + 1) # > len * 1.0 / HASH_MAX_LOAD (see _hashindex.c) self.chunks = ChunkIndex(capacity) marker = None while True: