On Mon, Feb 8, 2010 at 9:48 AM, Mark Kettenis <mark.kette...@xs4all.nl> wrote: >> So how do we move forward? > > For one thing, I'd like to see some real benchmarks. Does using a > larger buffer really speed up cp? You claim moving a "head" between > reads and writes takes time, but so does moving it between reads. And > modern drives have caches that may influence the behaviour.
That's a fair point. Unfortunately, I don't have that many hard drives to test. So I posted the diff. (I'm actually using a SSD drive right now, so I'm not even benefiting from this work, but I can find some real drives to test too.) > Also, your origional diff has a problem. The current cp > implementation creates "holes" if it encounters a block of zeroes. > The size of that block is coupled to the size of the buffer it uses > for reads and writes. Since you made that buffer larger, you'll > probably create less holes and waste more space. Read the diff more carefully. I know all about the hole code (I wrote it), and I was careful to preserve the same behavior.