Explorar o código

Merge pull request #1298 from ThomasWaldmann/borg-check-hash-load

fix/optimize initial hash table size for borg check
enkore %!s(int64=9) %!d(string=hai) anos
pai
achega
1e32ed1553
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      borg/archive.py

+ 1 - 1
borg/archive.py

@@ -826,7 +826,7 @@ class ArchiveChecker:
         """
         # 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: