]> arthur.barton.de Git - bup.git/commitdiff
hashsplit: increase READ_SIZE to 8 MB
authorJohannes Berg <johannes@sipsolutions.net>
Tue, 28 Apr 2020 21:11:16 +0000 (23:11 +0200)
committerRob Browning <rlb@defaultvalue.org>
Sun, 13 Jun 2021 16:32:17 +0000 (11:32 -0500)
It's not really possible to run bup with tiny amounts of memory,
so reading 1 MB or 8 MB doesn't make a significant difference
here.

However, python actually implements read() as mmap() (at least
on my Linux system), with the requested read size given to mmap
as the size. The kernel then doesn't appear to do any readahead
(which makes sense), which kills performance.

Even if this wasn't the case though, read() of 8MB isn't much
of an issue, so increase the size.

Note that 8 MB is also the size for the fadvise() code.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/hashsplit.py

index 01e11a67c6ea89884edb8fd6e1aa9373d0fa4b58..94d93ed36746ebb31e9dfa4bdf11ca1a205af80c 100644 (file)
@@ -11,7 +11,7 @@ from bup.helpers import sc_page_size
 _fmincore = getattr(helpers, 'fmincore', None)
 
 BLOB_MAX = 8192*4   # 8192 is the "typical" blob size for bupsplit
-BLOB_READ_SIZE = 1024*1024
+BLOB_READ_SIZE = 8 * 1024 * 1024
 MAX_PER_TREE = 256
 progress_callback = None
 fanout = 16