mirror of
https://github.com/borgbackup/borg.git
synced 2025-01-04 06:21:46 +00:00
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.
This commit is contained in:
parent
9bfd233ce1
commit
409ab9f612
1 changed files with 1 additions and 1 deletions
|
@ -826,7 +826,7 @@ def init_chunks(self):
|
||||||
"""
|
"""
|
||||||
# Explicitly set the initial hash table capacity to avoid performance issues
|
# Explicitly set the initial hash table capacity to avoid performance issues
|
||||||
# due to hash table "resonance"
|
# 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)
|
self.chunks = ChunkIndex(capacity)
|
||||||
marker = None
|
marker = None
|
||||||
while True:
|
while True:
|
||||||
|
|
Loading…
Reference in a new issue