[MERGE] Simple optimization of common annotate case

Ian Clatworthy ian.clatworthy at internode.on.net
Tue Jan 29 06:09:21 GMT 2008


John Arbash Meinel wrote:

> According to '--lsprof' this dropped the time spent directly in
> reannotate from 8s down to 1s. And manual 'time bzr annotate --show-ids'
> dropped from 13s to 8s.

On my VM, the difference is not as dramatic but still noticeable: 13.7
to 10.8 seconds.

bb:tweak

> +                if len(origins) == 1:
> +                    lines.append(origins.pop(), line))
> +                else:
> +                    lines.append((new_revision_id, line))

There's a syntax error on the second line above. :-( All tests pass with
that fixed. Otherwise, the change looks ok to me. You should probably
add a NEWS entry though. Something generic like "annotate faster" would
do IMO.

Ian C.



More information about the bazaar mailing list