[RFC] allow fulltext to be more dynamic
Dmitry Vasiliev
lists at hlabs.spb.ru
Wed Nov 22 13:19:31 GMT 2006
John Arbash Meinel wrote:
> Anyway, we really want to address our large-tree performance in other
> ways (breaking up the inventory by dir, using recursive 'last-changed'
> fields to avoid inspection of subdirs, etc). But this is a fairly simple
> fix, that is completely compatible with current versions of bzr.
+1
> + self._max_delta_chain = 200
> +
Isn't it better to always define such a constants at the class level?
> + count = 0
> + delta_size = 0
> + fulltext_size = None
> + delta_parents = first_parents
> + while count < self._max_delta_chain:
"for count in xrange(self._max_delta_chain):" seems more pythonic to me.
> + parent = delta_parents[0]
> + method = self._index.get_method(parent)
> + pos, size = self._index.get_position(parent)
> + if method == 'fulltext':
> + fulltext_size = size
> + break
> + delta_size += size
> + delta_parents = self._index.get_parents(parent)
> + count = count + 1
I'd prefer to localize often used variables inside loops (self._index in this
case).
> + if method == 'line-delta' or fulltext_size < delta_size:
> + return False
> + return True
Again I'd prefer just
return not (method == 'line-delta' or fulltext_size < delta_size)
--
Dmitry Vasiliev (dima at hlabs.spb.ru)
http://hlabs.spb.ru
More information about the bazaar
mailing list