[issue557] parsing tags takes time

Antoine Pitrou mercurial-bugs at selenic.com
Mon May 7 14:35:49 CDT 2007


New submission from Antoine Pitrou <antoine.pitrou at wengo.com>:

Hi,

I've got a repository with a lot of local tags (I generate a separate tag for
each pulled SVN revision, I've got 3225 of them), and some commands like "hg id"
and "hg tip" are not instantaneous like they usually are. They take around half
a second, which is not bad, but it means that with e.g. 10000 tags (which is not
unlikely given there are SVN projects with that many revs), those commands could
take two seconds.

Of course I understand that situation is hardly common ;-)

Here is the output with the profile option:

$ time hg id --lsprof
7985baa92281 (spip) tip/svn.3225
   CallCount     Total(s)    Inline(s) module:lineno(function)
        3225      0.1953      0.0509   mercurial.localrepo:263(parsetag)
       +3225      0.1043      0.0178   +mercurial.util:25(tolocal)
       +3225      0.0184      0.0092   +mercurial.node:19(bin)
       +3225      0.0080      0.0080   +mercurial.revlog:255(__contains__)
       +3225      0.0066      0.0066   +<method 'split' of 'str' objects>
       +3225      0.0037      0.0037   +<method 'strip' of 'str' objects>
           1      0.4224      0.0385   mercurial.localrepo:258(tags)
       +3225      0.1953      0.0509   +mercurial.localrepo:263(parsetag)
       +3225      0.0660      0.0173   +mercurial.util:46(fromlocal)
       +3225      0.0032      0.0032   +mercurial.i18n:12(<lambda>)
          +1      0.0001      0.0001   +mercurial.util:1004(o)
          +1      0.1193      0.0001   +mercurial.localrepo:312(_hgtagsnodes)
        6454      0.0727      0.0295   <method 'decode' of 'str' objects>
       +3225      0.0223      0.0117   +encodings.iso8859_15:14(decode)
       +3228      0.0198      0.0096   +encodings.utf_8:15(decode)
          +2      0.0011      0.0002   +encodings:70(search_function)
        6453      0.0638      0.0274   <method 'encode' of 'unicode' objects>
       +3228      0.0364      0.0096   +encodings.iso8859_15:11(encode)
        3228      0.0268      0.0268   <_codecs.charmap_encode>
        3692      0.0610      0.0233   mercurial.revlog:235(__getitem__)
       +3691      0.0180      0.0110   +struct:77(unpack)
       +3692      0.0040      0.0040   +<isinstance>
         +51      0.0157      0.0002   +mercurial.revlog:230(load)
        3222      0.0730      0.0186   mercurial.revlog:485(parentrevs)
       +3222      0.0543      0.0196   +mercurial.revlog:235(__getitem__)
        3228      0.1049      0.0178   mercurial.util:25(tolocal)
       +3228      0.0528      0.0164   +<method 'encode' of 'unicode' objects>
       +3228      0.0343      0.0141   +<method 'decode' of 'str' objects>
           1      0.0906      0.0176   mercurial.revlog:720(heads)
       +3222      0.0730      0.0186   +mercurial.revlog:485(parentrevs)
          +1      0.0000      0.0000   +mercurial.revlog:471(rev)
          +1      0.0000      0.0000   +mercurial.revlog:469(node)
          +1      0.0000      0.0000   +<built-in method fromkeys>
          +1      0.0000      0.0000   +mercurial.revlog:468(count)
        3225      0.0660      0.0173   mercurial.util:46(fromlocal)
       +3225      0.0377      0.0154   +<method 'decode' of 'str' objects>
       +3225      0.0110      0.0110   +<method 'encode' of 'unicode' objects>
0.45user 0.16system 0:00.68elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+1941minor)pagefaults 0swaps

----------
messages: 3060
nosy: antoine
priority: wish
status: unread
title: parsing tags takes time

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue557>
____________________________________________________



More information about the Mercurial-devel mailing list