[PATCH 0 of 3] introducing context to changeset_printer

Alexander Solovyov piranha at piranha.org.ua
Mon Oct 20 16:53:20 UTC 2008


On 2008-10-18, Matt Mackall wrote:

> On Fri, 2008-10-17 at 23:50 +0300, Alexander Solovyov wrote:
>> Profiling with patches:
>> ===================
>>    CallCount    Recursive    Total(ms)   Inline(ms) module:lineno(function)
>>         7108            0      1.8398      0.2906   mercurial.cmdutil:607(_show)
> ...
>> Profiling with patches:
>> ===================
>>    CallCount    Recursive    Total(ms)   Inline(ms) module:lineno(function)
>>         7105            0      1.6118      0.2481
>> mercurial.cmdutil:604(_show)

> I'm going to assume the second set is withOUT, yes? It seems to have 3
> fewer things to show.

Yes, second is without, my mistake.

> It'd probably be wiser to do you benchmark on something other than the
> repo you're modifying.

Ok, I've profiled "hg log" on another big repo (bigger than hg's). BTW,
speed difference is introduced by first patch.


Without patches:

===============
   CallCount    Recursive    Total(ms)   Inline(ms) module:lineno(function)
       10540            0      2.5918      0.4125   mercurial.cmdutil:604(_show)
      +64103            0      0.2362      0.1887   +mercurial.ui:377(write)
      +10540            0      1.3409      0.1728   +mercurial.changelog:137(read)
      +10540            0      0.2536      0.1298   +mercurial.util:1652(datestr)
      +53563            0      0.0447      0.0447   +gettext:191(gettext)
      +10540            0      0.1129      0.0337   +mercurial.util:99(tolocal)
       74643            0      0.2718      0.2145   mercurial.ui:377(write)
      +64103            0      0.0475      0.0475   +<method 'extend' of 'list' objects>
      +10540            0      0.0098      0.0098   +<method 'write' of 'file' objects>
           1            0      3.1434      0.1747   mercurial.commands:1754(log)
      +10540            0      2.7397      0.0644   +mercurial.cmdutil:596(show)
      +21107            0      0.0678      0.0517   +mercurial.cmdutil:1114(iterate)
      +42162            0      0.0309      0.0309   +<method 'get' of 'dict' objects>
      +10540            0      0.0652      0.0296   +mercurial.cmdutil:583(flush)
      +10540            0      0.0123      0.0123   +mercurial.revlog:501(node)
       10541            0      1.3410      0.1728   mercurial.changelog:137(read)
      +10541            0      0.7704      0.1704   +mercurial.revlog:917(revision)
      +21082            0      0.2256      0.0659   +mercurial.util:99(tolocal)
      +10541            0      0.0930      0.0504   +mercurial.changelog:124(decode_extra)
      +21082            0      0.0314      0.0314   +<method 'split' of 'str' objects>
      +10541            0      0.0173      0.0173   +<binascii.unhexlify>
       10543            0      0.7905      0.1710   mercurial.revlog:917(revision)
      +10848            0      0.2929      0.0846   +mercurial.revlog:867(chunk)
      +10543            0      0.1708      0.0655   +mercurial.revlog:54(hash)
      +10543            0      0.0818      0.0494   +mercurial.revlog:505(parents)
      +10543            0      0.0327      0.0213   +mercurial.revlog:471(_loadindex)
      +10543            0      0.0162      0.0162   +<mercurial.mpatch.patches>
       10639            0      0.1395      0.1395   <zlib.decompress>
       10540            0      0.2536      0.1298   mercurial.util:1652(datestr)
      +10540            0      0.0669      0.0669   +<time.strftime>
      +21080            0      0.0285      0.0285   +<method 'replace' of 'str' objects>
      +10540            0      0.0200      0.0200   +<time.gmtime>
      +10540            0      0.0079      0.0079   +<abs>
          +1            0      0.0005      0.0000   +mercurial.demandimport:71(__getattribute__)
       31654            0      0.3388      0.0997   mercurial.util:99(tolocal)
      +31654            0      0.1858      0.0764   +<method 'decode' of 'str' objects>
      +31654            0      0.0533      0.0533   +<method 'encode' of 'unicode' objects>
       42195            0      0.2059      0.0963   <method 'decode' of 'str' objects>
      +31654            0      0.1094      0.0593   +encodings.utf_8:15(decode)
          +1            0      0.0003      0.0000   +encodings:70(search_function)
       10848            0      0.2929      0.0846   mercurial.revlog:867(chunk)
      +10848            0      0.1634      0.0239   +mercurial.revlog:97(decompress)
      +10848            0      0.0218      0.0218   +mercurial.revlog:510(start)
      +10848            0      0.0107      0.0107   +mercurial.revlog:514(length)
      +10846            0      0.0084      0.0084   +<len>
         +53            0      0.0040      0.0003   +mercurial.revlog:868(loadcache)
===============

With patches:

===============
   CallCount    Recursive    Total(ms)   Inline(ms) module:lineno(function)
       10540            0      2.9651      0.4708   mercurial.cmdutil:607(_show)
      +64103            0      0.2445      0.1965   +mercurial.ui:377(write)
      +10540            0      0.2565      0.1310   +mercurial.util:1652(datestr)
      +10540            0      0.0963      0.0628   +mercurial.cmdutil:671(_meaningful_parentrevs)
      +53563            0      0.0446      0.0446   +gettext:191(gettext)
      +21080            0      0.0566      0.0411   +mercurial.context:90(branch)
       74643            0      0.2802      0.2222   mercurial.ui:377(write)
      +64103            0      0.0479      0.0479   +<method 'extend' of 'list' objects>
      +10540            0      0.0101      0.0101   +<method 'write' of 'file' objects>
       10543            0      0.7960      0.1749   mercurial.revlog:917(revision)
      +10848            0      0.2961      0.0854   +mercurial.revlog:867(chunk)
      +10543            0      0.1716      0.0651   +mercurial.revlog:54(hash)
      +10543            0      0.0814      0.0500   +mercurial.revlog:505(parents)
      +10543            0      0.0314      0.0209   +mercurial.revlog:471(_loadindex)
      +10543            0      0.0168      0.0168   +<mercurial.mpatch.patches>
       10541            0      1.3504      0.1736   mercurial.changelog:137(read)
      +10541            0      0.7759      0.1743   +mercurial.revlog:917(revision)
      +21082            0      0.2291      0.0668   +mercurial.util:99(tolocal)
      +10541            0      0.0929      0.0502   +mercurial.changelog:124(decode_extra)
      +21082            0      0.0318      0.0318   +<method 'split' of 'str' objects>
      +10541            0      0.0171      0.0171   +<binascii.unhexlify>
           1            0      3.7315      0.1620   mercurial.commands:1754(log)
      +10540            0      3.1332      0.0729   +mercurial.cmdutil:596(show)
      +21107            0      0.0681      0.0520   +mercurial.cmdutil:1098(iterate)
      +10540            0      0.2293      0.0322   +mercurial.localrepo:101(__getitem__)
      +10540            0      0.0675      0.0317   +mercurial.cmdutil:583(flush)
      +42162            0      0.0308      0.0308   +<method 'get' of 'dict' objects>
       10639            0      0.1409      0.1409   <zlib.decompress>
       10540            0      0.2565      0.1310   mercurial.util:1652(datestr)
      +10540            0      0.0678      0.0678   +<time.strftime>
      +21080            0      0.0288      0.0288   +<method 'replace' of 'str' objects>
      +10540            0      0.0205      0.0205   +<time.gmtime>
      +10540            0      0.0080      0.0080   +<abs>
          +1            0      0.0005      0.0000   +mercurial.demandimport:71(__getattribute__)
       31654            0      0.3436      0.1007   mercurial.util:99(tolocal)
      +31654            0      0.1887      0.0780   +<method 'decode' of 'str' objects>
      +31654            0      0.0541      0.0541   +<method 'encode' of 'unicode' objects>
       42195            0      0.2088      0.0978   <method 'decode' of 'str' objects>
      +31654            0      0.1108      0.0596   +encodings.utf_8:15(decode)
          +1            0      0.0003      0.0000   +encodings:70(search_function)
       10848            0      0.2961      0.0854   mercurial.revlog:867(chunk)
      +10848            0      0.1655      0.0246   +mercurial.revlog:97(decompress)
      +10848            0      0.0222      0.0222   +mercurial.revlog:510(start)
      +10848            0      0.0105      0.0105   +mercurial.revlog:514(length)
      +10846            0      0.0083      0.0083   +<len>
         +53            0      0.0041      0.0003   +mercurial.revlog:868(loadcache)
===============

-- 
Alexander



More information about the Mercurial-devel mailing list