[MERGE] Be more efficient with sha operations during commit
Ian Clatworthy
ian.clatworthy at internode.on.net
Mon Sep 24 04:53:18 BST 2007
Robert Collins wrote:
> This saves 10 seconds or so on an initial commit of a mozilla tree by
> using sha_string, rather than sha_strings.
bb:tweak
> As part of it I've removed an unused function from the _KnitData class,
As _KnitData is a private class, it's not strictly needed though
mentioning in NEWS that add_record was removed would be nice.
> @@ -908,13 +901,20 @@
> if delta:
> options.append('line-delta')
> store_lines = self.factory.lower_line_delta(delta_hunks)
> + size, bytes = self._data._record_to_data(version_id, digest,
> + store_lines)
> else:
> options.append('fulltext')
> + # get mixed annotation + content and feed it into the
> + # serialiser.
> store_lines = self.factory.lower_fulltext(content)
> + size, bytes = self._data._record_to_data(version_id, digest,
> + store_lines)
Setting of size & bytes is common to both branches of the if statement
so pull it out as common code.
Ian C.
More information about the bazaar
mailing list