borgbackup/borg

FUSE micro-opt benchmarking

Open

#5.110 geöffnet am 13. Apr. 2020

Auf GitHub ansehen
 (4 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (732 Forks)batch import
cmd: mounteasygood first issuehelp wanted

Repository-Metriken

Stars
 (10.086 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 5T 12h) (91 gemergte PRs in 30 T)

Beschreibung

If somebody has some time for FUSE benchmarking:

diff --git a/src/borg/fuse.py b/src/borg/fuse.py
index 429790e4..27ab1c1a 100644
--- a/src/borg/fuse.py
+++ b/src/borg/fuse.py
@@ -644,12 +644,12 @@ def read(self, fh, offset, size):
                 data = self.data_cache[id]
                 if offset + n == len(data):
                     # evict fully read chunk from cache
-                    del self.data_cache[id]
+                    pass # del self.data_cache[id]
             else:
                 data = self.key.decrypt(id, self.repository_uncached.get(id))
-                if offset + n < len(data):
+                if True: # offset + n < len(data):
                     # chunk was only partially read, cache it
                     self.data_cache[id] = data
             parts.append(data[offset:offset + n])
             offset = 0
             size -= n

The 2 changes remove selective caching only of partially read chunks and cache removal of fully read chunks. While this sounds obvious when thinking about sequential reads, it maybe is counterproductive for repeating chunks (like all-zero chunks).

If someone wants to benchmark these (and maybe also try with a bigger sized self.data_cache), that would be helpful!

Try:

  • big files, small files
  • files with repeating chunks (like sparse [VM] disk images)
  • default chunksize, small chunksize

Contributor Guide