]> arthur.barton.de Git - bup.git/commit
git.py: avoid repeated string-copying in tree_decode()
authorYung-Chin Oei <yungchin@yungchin.nl>
Wed, 26 Sep 2012 19:35:45 +0000 (20:35 +0100)
committerRob Browning <rlb@defaultvalue.org>
Fri, 28 Sep 2012 02:27:31 +0000 (21:27 -0500)
commit8c4650dfba5424f483ed0b4c33988644023dbd88
tree701b279fa615dab0c9cff57f9603a3b82b5be36d
parentbdc3031625ec7ae1f37a11dad3b58e9befd23217
git.py: avoid repeated string-copying in tree_decode()

git.tree_decode showed bad perfomance when dealing with large trees,
because it required string-copying quadratically in the number of tree
elements. By removing unnecessary copying, performance is improved at
all tree sizes, and significantly so for larger trees.

The problem became particularly apparent in combination with another bug
in bup (patch for which forthcoming), that allowed trees to grow without
bound when backing up sparse files.

Reported-by: trebor <robert.rebstock@tempelhof-projekt.de>
Signed-off-by: Yung-Chin Oei <yungchin@yungchin.nl>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/git.py