]> arthur.barton.de Git - bup.git/commit
git: shun buffers in packidxes
authorRob Browning <rlb@defaultvalue.org>
Fri, 27 Dec 2019 19:02:42 +0000 (13:02 -0600)
committerRob Browning <rlb@defaultvalue.org>
Sat, 18 Jan 2020 18:53:02 +0000 (12:53 -0600)
commitd79f8b29852acda226091cb1b3791803def54e0d
tree6e232a13a9d30ea02c30ada4462c5c12056eb5eb
parentd7c180a99b633877667108652e660037843eb083
git: shun buffers in packidxes

Rework PackIdx to avoid buffers which are reasonably heavyweight, and
will be even larger (as memoryviews) in python 3 (require ~200 bytes).
Instead, just use direct offsets into the underlying mmap -- slicing
an mmap currently just produces bytes.

Store the fanout table as a homogeneous array rather than a list or
tuple with individually allocated integers.

Instead of looking up hashes one at a time, traverse the index during
gc via its iterator.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/gc.py
lib/bup/git.py