performance suggestion: sparse files

Martin Pool mbp at sourcefrog.net
Wed Sep 10 12:56:01 EST 2003


On  9 Sep 2003 "Jon Howell" <jonh at jonh.net> wrote:

> > Actually you can guess by looking at the allocated-blocks measure,
> > and use this to guess whether it's preallocated zeros or sparse,
> > which might be useful for backups.  But there is no way around
> > reading the blocks.
> Sure. Bummer; that's a lot of memory bus bandwidth (having the kernel
> zero-fill the blocks, then having rsync zero-compare them) wasted.

If the program mmaps the file the kernel will fill the vm with COW
references to the zero page and it will be quite cheap.

> Seems like a fcntl() is in order.

Repeat after me: premature optimization is the root of all evil.

-- 
Martin 



More information about the rsync mailing list