Clone performance for files consisting of many zeros differs significantly on Linux and Windows.

Schueler Nikolaus (LQKG IT RDS) Nikolaus.Schueler at lantiq.com
Fri Nov 2 06:24:20 CDT 2012


Hi all,

there seems to be a problem with cloning big files consisting only of zeros. Cloning times for Linux and Windows differ quite a lot. Any idea about that?

How to reproduce:

Create a repo on a server:

hg init manyzeros
cd manyzeros
dd if=/dev/zero of=fileofzeros bs=1M count=250
hg add fileofzeros
hg ci -m "Added a file"

In our case this is served from a backend using mod_wsgi, using a reverse proxy as fronted. Backend and frontend run on Apache. Server OS is Linux, Redhat 5.5.

Now clone the repo from both Linux and Windows, using the --time option. The values are as follows.

Note that the values are not 100% correct, as you have to type in a password and the time needed for this may be slightly different.

Time for Linux:

$ ~/tmp/original-mercurial/bin/hg clone https://mtstest.lantiq.com/~hgtest/repo/HGSUP-779/manyzeros --time
http authorization required
realm: hgtest team repos
user: schueler
password: 
destination directory: manyzeros
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
time: real 17.290 secs (user 6.010+0.000 sys 0.610+0.000)

On Windows:

D:\Users\schueler\tmp>"c:\Program Files\Mercurial\hg.exe" clone https://mtstest.
lantiq.com/~hgtest/repo/HGSUP-779/manyzeros --time
http authorization required
realm: hgtest team repos
user: schueler
password:
destination directory: manyzeros
requesting all changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
time: real 165.758 secs (user 95.161+0.000 sys 49.250+0.000)

So its roughly 17 seconds on Linux vs. 166 seconds on Windows. Does anyone have an idea what the root cause for this big difference could be?


Additional info:

The Windows version is Windows 7, the Linux client is Redhat 5.5.

I use a recent build of Mercurial for cloning on Windows:

$ ~/tmp/original-mercurial/bin/hg version
Mercurial Distributed SCM (version 2.4-rc+40-0188ddfa844e)

and a recent binary distribution on Windows:

D:\Users\schueler\tmp>"c:\Program Files\Mercurial\hg.exe" version
Mercurial Distributed SCM (version 2.3.2)

The server-side version of Mercurial is 2.1.

Performance of both machines is roughly equivalent. 

On Linux:

$ python -c "from test import pystone; pystone.main()"      
Pystone(1.1) time for 50000 passes = 0.53
This machine benchmarks at 94339.6 pystones/second

On Windows:

H:\>python -c "from test import pystone; pystone.main()"
Pystone(1.1) time for 50000 passes = 0.61229
This machine benchmarks at 81660.6 pystones/second

Regards

Nik

Lantiq Configuration Management Solutions
http://wiki.lantiq.com/display/IT/Configuration+Management




More information about the Mercurial-devel mailing list