Incorrect tracking of missing parents?
Andrew Bennetts
andrew.bennetts at canonical.com
Mon May 11 03:58:53 BST 2009
John Arbash Meinel wrote:
[...]
> I'm looking at implementing stacking for -dev6 repositories, and I found
> out that I need to implement _GCIndex.get_missing_parents, which is
> implemented in Knits by setting a 'track parents' flag.
>
> When I looked at it, I saw that it does this:
[....]
> Now, I know that the final result then does difference update:
[...]
> I just get the feeling that the parent_refs.discard() from above isn't
> really helping, and actually keeping track via 2 sets might be a lot
> better. This is also true for
Right. There's a tradeoff here. Keeping 2 sets would work, but implies
keeping every new key and every parent in memory until the transaction is
committed. The hope with this implementation is that is can avoid the worst
of that, depending as you notice on the order the records are inserted.
Possibly a LRUCache or something like that may be a better compromise.
I'm happy for this to change, but I think we should measure the effects to
make sure we're actually improving things.
[...]
> To 'get it done', I'm starting with the bad form of just walking
> 'iter_all_entries()' over everything, but I figure I should make sure I
> understand the existing algorithm, and how to bring it across.
Well, so long as correctness is preserved, I don't mind what you do w.r.t.
to performance ;)
-Andrew.
More information about the bazaar
mailing list