Running multiple commands on commandserver interface
Idan Kamara
idankk86 at gmail.com
Thu Apr 12 16:50:50 UTC 2012
On Thu, Apr 12, 2012 at 6:55 PM, Matt Mackall <mpm at selenic.com> wrote:
> On Thu, 2012-04-12 at 17:33 +0200, Ton Plomp wrote:
> > Yes Idan,
> >
> > removing the null byte on the client side did fix the issue!
> >
> > For timing info I ran 100 hg version, versus 100 times version on the hg
> > commandserver:
> > Pipe: 4,1 seconds
> > CLI: 15 seconds
>
> Hmm, that's a lot slower than I would have hoped. It runs about 10x
> faster here (100 loops .5 seconds with python-hglib), but it seems to
> still be doing a bunch of unnecessary work on each call.
Did you call rawcommand or version on the repo object? Because the latter
is cached.
This is what I'm getting:
$ python -m timeit -n 1000 -s 'import hglib; r = hglib.open()' -c
'r.rawcommand(["version"])'
1000 loops, best of 3: 30 usec per loop
$ time hg version 1>/dev/null
real 0m0.092s
user 0m0.088s
sys 0m0.004s
But version is probably not the best candidate for a benchmark.
> strace suggests it's rereading hgrc files and checking dirstate.
>
Yeah the configuration is copied on every command invocation so it
looks like some parts are reread through ui.copy().
It is odd that we're stating dirstate, the faulty line seems to be:
self.repo.ui = self.repo.dirstate._ui = self.repoui.copy()
http://selenic.com/repo/hg/file/ee163a9cf37c/mercurial/commandserver.py#l187
Where we're touching dirstate for some ui thingy (yet again) and that
triggers filecache.
>
> --
> Mathematics is the supreme nostalgia of our time.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20120412/59c1a523/attachment-0002.html>
More information about the Mercurial
mailing list