Code review comment for lp:~jameinel/bzr/2.0.1-faster-log-dir-bug374730

Revision history for this message
John A Meinel (jameinel) wrote :

This is my 'phase 1' for making 'bzr log DIR' faster.

It implements a custom 'CHKInventory.filter()' which only has to deal in the actual files that are requested, rather than always doing 'iter_entries()' and walking the whole tree.

This makes 'bzr log DIR' scale based on the number of entries in DIR. In my testing,

5m30s bzr.dev log tools
5m30s newbzr log bzrlib
0m36s newbzr log tools

So when the number of files is low, the time drops from 5m30s => 36s, which is great.

The next step is probably going to bypass 'filter()' for 'log DIR' and solely layer on top of 'iter_changes'. My initial (broken) testing showed that it stayed consistently around 36s for both bzrlib and tools, which is certainly a lot better.

I'd like to land this in the 2.0.x series, because it seems like a simple bug fix.

The size of the delta is a bit large, because it turned out that CHKInventory.filter() wasn't tested at all. (See my mailing list thread about what 'per_inventory' is actually supposed to be testing.) I went ahead and made 'per_inventory' actually care about both inventory implementations, and moved the tests around accordingly.

« Back to merge proposal