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

Cameron Simpson cs at zip.com.au
Sun Nov 4 14:33:36 CST 2012


On 02Nov2012 11:24, Schueler Nikolaus (LQKG IT RDS) <Nikolaus.Schueler at lantiq.com> wrote:
| 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?
[...]

Leaving aside hypothetical network efficiency stuff and so forth (Matt's
--profile suggestion may shed some fine grained light on things), does
Mercurial support sparse files?

On UNIX a sparse file is a file with portions not backed by actual disc
blocks. Reads to those areas return zeroes. If Mercurial takes the
trouble to notice runs of zeros, it can simply not write them to the new
file (save for a tiny write at the end to ensure the file is the right
length). In consequence the filesystem will not be allocating disc
blocks or writing to them for the vast majority of the file, which may
explain the speed difference.

This is only one possibility of course...

Cheers,
-- 
Cameron Simpson <cs at zip.com.au>

A clean desk is the sign of a blank mind.


More information about the Mercurial-devel mailing list