]> arthur.barton.de Git - bup.git/commit
Use a PackBitmap file as a quicker way to check .idx files.
authorAvery Pennarun <apenwarr@gmail.com>
Tue, 12 Jan 2010 05:52:21 +0000 (00:52 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Tue, 12 Jan 2010 06:36:32 +0000 (01:36 -0500)
commit0ef50f16fc4027c8296ef0198a82baf0bb33b94c
treea599458b937d7ced513bdbb193ad169409c1d56d
parent7284f09b451b2f40ce40f1d238782793f0ae79f1
Use a PackBitmap file as a quicker way to check .idx files.

When we receive a new .idx file, we auto-generate a .map file from it.  It's
essentially an allocation bitmap: for each 20-bit prefix, we assign one bit
to tell us if that particular prefix is in that particular packfile.  If it
isn't, there's no point searching the .idx file at all, so we can avoid
mapping in a lot of pages.  If it is, though, we then have to search the
.idx *too*, so we suffer a bit.

On the whole this reduces memory thrashing quite a bit for me, though.
Probably the number of bits needs to be variable in order to work over a
wider range of packfile sizes/numbers.
git.py
t/tgit.py