[rfc] VersionedFile.add_lines() returns sha1 sum
John Arbash Meinel
john at arbash-meinel.com
Thu Aug 17 19:56:17 BST 2006
I'm tracking through some of our inefficiencies during commit. This is a
small one, so I don't know that it is worth changing an API to fix it.
But basically, when doing a commit, we call versioned_file.add_lines()
to commit the new text to the knit or weave. Part of that process
requires the versioned_file to sha1 the lines, so that it can record the
correct sha1 value.
And then we need to record the sha1 in the final inventory. This means
that we pass over the data 2 times to compute a sha1 sum. In an
'--lsprof' of a kernel sized tree, it takes approx 9 seconds to read the
bytes of every file (obviously cached), and then 10s to sha1 everything.
So there is another 10s of duplicated sha1 summing.
Now this is 10s / 12min, so it isn't a huge overhead. But it seems a
semi-obvious bug that should be fixed. Is it worth changing the api?
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060817/39f447ca/attachment.pgp
More information about the bazaar
mailing list