Code review comment for lp:~bzr/bzr/faster-ls

Revision history for this message
Ian Clatworthy (ian-clatworthy) wrote :

This patch does two things:

* it fixes 'ls DIR --from-root' so that only things in DIR are shown, not everything

* it fixes ls performance by leveraging recent enhancements to iter_entries_by_dir() and list_files().

On OpenOffice.org, here are the speed-ups:

* ls: 2.4 to 1.1 seconds

* ls -r-1: 54.3 to 1.1 seconds

Unlike the previous submission, this one doesn't bother moving the code in builtins.py out into a separate module/method. Right now, YAGNI. Instead, it explicitly tries to minimise the differences to bzr.dev to ease review. (As an example, there's an 'if True' block currently included so that the diff for reviewers makes it clearer as to exactly what got changed. I plan to remove that on landing, of course.)

In summary, I think this is a step forward and is worth landing. It doesn't go as far as John would like and move to an iter_entries_by_dir() solution instead of the existing list_files() one. But frankly, ls just isn't that important as a command to *me* (vs other priorities), so I don't plan to spend any more time on it beyond the bare minimum above.

« Back to merge proposal