Chunks?

Martin Geisler mg at aragost.com
Tue Dec 6 05:12:28 CST 2011


"Steve Dyer" <Steve.Dyer at homeserve.com> writes:

> Oh ok thanks. The problem I'm having at the moment is that cloning a
> repository is taking a while, like about 10 minutes, and this is on a
> repository where I haven't actually done any work yet, just the
> initial load of our code into it. The code base itself is about 400Mb
> with about 11,000 files. Is this normal?

The question is really how long it normally takes to copy 400 MB on your
network. You also need to tell us how you clone: via SSH, HTTP or (the
bad option) via a shared network drive.

I recently worked with Unity Technologies and there we saw clone speeds
of about 20 Mbit from a big server over HTTP. If we configured

  [server]
  uncompressed = True

on the server and used 'hg clone --uncompressed', then we saw burst
traffic of 800 Mbit, which was much more satisfactory on a 1 Gbit
network. More data is transferred with --uncompressed, but less CPU is
spent on compressing the data on the server and that really paid off
when cloning inside a LAN.

> This the process I followed to load, so I am not sure if there is a
> better way to do the initial load of a repo.
>
> 1. Create new repository
> 2. Copy in my current source code base in to that directory
> 3. Commit

That's the right way to import an existing code base without any
history. People often try to preserve (part of) the history, but the
above is how to do it when you just want to make a cut and start using
Mercurial right away.

> The next steps were to clone this 5 times. The reason is that
> currently we have a single "core" codebase, and this then feeds into 5
> sub code bases. [...]

Where are the 5 clones located? On your local disk or on a network
drive? If both the core repository and the clones are on a network
drive, then you'll see the worst possible performance: Mercurial must
download the data and then upload it again to write it into the clone.

Also, clones that are only used for such administrative purposes can
(and should) be made with 'hg clone --noupdate'. That skips the creation
of a working copy so Mercurial can simply hardlink all the files in the
.hg folder. That should take seconds, even for a repository of your
size: I just tried it with the 2.3 GB OpenOffice repo and it took 16 sec
here with a cold disk cache.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://mercurial.aragost.com/kick-start/


More information about the Mercurial mailing list