744 for p in s.fncache.entries: |
745 for p in s.fncache.entries: |
745 s.encode(p) |
746 s.encode(p) |
746 timer(d) |
747 timer(d) |
747 fm.end() |
748 fm.end() |
748 |
749 |
|
750 @command('perfbdiff', revlogopts + formatteropts, '-c|-m|FILE REV') |
|
751 def perfbdiff(ui, repo, file_, rev=None, **opts): |
|
752 """benchmark a bdiff between a revision and its delta parent""" |
|
753 if opts.get('changelog') or opts.get('manifest'): |
|
754 file_, rev = None, file_ |
|
755 elif rev is None: |
|
756 raise error.CommandError('perfbdiff', 'invalid arguments') |
|
757 |
|
758 r = cmdutil.openrevlog(repo, 'perfbdiff', file_, opts) |
|
759 |
|
760 node = r.lookup(rev) |
|
761 rev = r.rev(node) |
|
762 dp = r.deltaparent(rev) |
|
763 |
|
764 text1 = r.revision(dp) |
|
765 text2 = r.revision(node) |
|
766 |
|
767 def d(): |
|
768 bdiff.bdiff(text1, text2) |
|
769 |
|
770 timer, fm = gettimer(ui, opts) |
|
771 timer(d) |
|
772 fm.end() |
|
773 |
749 @command('perfdiffwd', formatteropts) |
774 @command('perfdiffwd', formatteropts) |
750 def perfdiffwd(ui, repo, **opts): |
775 def perfdiffwd(ui, repo, **opts): |
751 """Profile diff of working directory changes""" |
776 """Profile diff of working directory changes""" |
752 timer, fm = gettimer(ui, opts) |
777 timer, fm = gettimer(ui, opts) |
753 options = { |
778 options = { |