]> arthur.barton.de Git - bup.git/commit
Massive speedups to bupindex code.
authorAvery Pennarun <apenwarr@gmail.com>
Sun, 31 Jan 2010 22:59:33 +0000 (17:59 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Tue, 2 Feb 2010 06:01:57 +0000 (01:01 -0500)
commite27c726ffe35403061a4e53147f7f27b3647dcb4
tree0ae26a6c3c5fe1bd8a15280887a3707d49ea6147
parent62f3faef86b6e2e7f32b12b14d7cf637a3c36eba
Massive speedups to bupindex code.

The old file format was modeled after the git one, but it was kind of dumb;
you couldn't search through the file except linearly, which is pretty slow
when you have hundreds of thousands, or millions, of files.  It also stored
the entire pathname of each file, which got very wasteful as filenames got
longer.

The new format is much quicker; each directory has a pointer to its list of
children, so you can jump around rather than reading linearly through the
file.  Thus you can now 'bup index -p' any subdirectory pretty much
instantly.  The code is still not completely optimized, but the remaining
algorithmic silliness doesn't seem to matter.

And it even still passes unit tests!  Which is too bad, actually, because I
still get oddly crashy behaviour when I repeatedly update a large index. So
there are still some screwy bugs hanging around.  I guess that means we need
better unit tests...
cmd-index.py
helpers.py
index.py
t/sampledata/b2/foozy [new file with mode: 0644]
t/sampledata/b2/foozy2 [new file with mode: 0644]
t/test.sh
t/tindex.py