[MERGE] Don't use set.difference_update()

Robert Collins robertc at robertcollins.net
Thu Jul 26 00:04:05 BST 2007


On Wed, 2007-07-25 at 16:32 -0500, John Arbash Meinel wrote:
> 
> 
> So we pay about 4x to check for any ghosts, in a graph that doesn't
> have any
> ghosts in it. And '_KnitIndex.get_parents()' does that same check for
> each call.
> 
> It seems like it might be a better trade off to build up a graph of
> what
> entries are actually ghosts when we read the index, rather than look
> after the
> fact.
> 
> I think it would be pretty easy to change the parser. For one thing,
> if it
> parses an offset, it knows that entry cannot be a ghost. And then it
> only has
> to check to see if a new record was originally marked as a ghost
> (ghost filling).
> 
> It adds an extra dictionary check, but it is one for a dictionary that
> is
> typically empty, and at a minimum is small.
> 
> 
> 
> Overall, a lot of commands require Repository.get_revision_graph() and
> this
> improves it to 2x. It also improves VF.get_graph() for whenever that
> is used. 

We want to remove full index reads though; which my repository branch
does; so I'd be wary of spending time optimising the existing knit index
code as those indices cannot be partially read due to the offsets being
in 'records' not in bytes.

Thanks for figuring out that it was difference_update that was slow, I
was going to get onto that as soon as I was a little better.

Repository.get_revision_graph really should be entirely delegated to the
knit though as per the discussion I had with Martin about my patch.

+1
Rob



-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20070726/aacb4226/attachment.pgp 


More information about the bazaar mailing list