darcs performance

Donald Bruce Stewart dons at cse.unsw.edu.au
Sun Apr 1 07:38:18 EDT 2007


sven.panne:
> [ Well, not exactly a GHC problem, but I think that the mailing list fits, 
> anyway. ]
> 
> When getting a repo via HTTP, darcs seems to be *much* faster than via SSH. 
> Here as an example the cpphs repo, 3.7 patches per second vs. 0.7 patches per 
> second (almost unusable for large/old repos):
> 
> -------------------------------------------------------------------------------------------------
> panne at spock:~> time darcs get --complete http://darcs.haskell.org:/cpphs
> Applying patch 189 of 189... done.
> Finished getting.
> 
> real    0m50.998s
> user    0m0.180s
> sys     0m0.068s
> panne at spock:~> rm -rf cpphs/
> panne at spock:~> time darcs get --complete 
> panne at darcs.haskell.org:/home/darcs/cpphs
> Applying patch 189 of 189... done.
> Finished getting.
> 
> real    4m22.311s
> user    0m0.228s
> sys     0m0.080s
> -------------------------------------------------------------------------------------------------
> 
> The SSH protocol is a bit more complicated than HTTP, but not by a factor of 
> 5. :-( Is there a misconfiguration on my box or does this happen for other 
> people, too? I'm using darcs 1.0.8 on openSUSE 10.2 x86_64.
> 
> Cheers,
>    S.
> 

Are you using master/slave connections in ssh? This will let you reuse a
single control connection in ssh, avoiding the need to reauthenticate to
get each patch (and there's 2 or 3 of these per patch).

In my .ssh/config file I have, for example:

    Host haskell-m
    Hostname cvs.haskell.org
    ControlMaster yes
    ControlPath ~/.ssh/ctl-haskell
    Compression yes

    Host haskell-s
    ControlMaster no
    ControlPath ~/.ssh/ctl-haskell
    Compression yes

which sets up haskell-m as the alias for a 'master' connection to the
old cvs server, and haskell-s as a slave connection. Once I've set up a
single master connection to haskell-m, 

    ssh haskell-m

I can then have darcs pull over a slave connection:

    darcs pull haskell-s:/foo/bar/repo

And it will not need to reauthenticate each time == performance boost.

-- Don



More information about the Cvs-ghc mailing list