Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0
On 05/01/2012 05:59 PM, Pádraig Brady wrote:
> Now many coreutils already provide such a hint to the kernel:
>http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commit;h=47076e3c
> But copy.c does not currently. I'm not sure why I didn't
> do it for copy.c now, but I look into adding it.
The attached seems to give another 5% speedup!
$ dd bs=1MB count=200 if=/dev/zero of=file.in
$ dd of=file.in oflag=nocache conv=notrunc,fdatasync count=0
$ time ./cp-before file.in /dev/shm/; rm /dev/shm/file.in
real 0m0.843s
user 0m0.005s
sys 0m0.417s
$ dd of=file.in oflag=nocache conv=notrunc,fdatasync count=0
$ time ./cp-before file.in /dev/shm/; rm /dev/shm/file.in
real 0m0.856s
user 0m0.002s
sys 0m0.422s
$ dd of=file.in oflag=nocache conv=notrunc,fdatasync count=0
$ time ./cp-after file.in /dev/shm/; rm /dev/shm/file.in
real 0m0.809s
user 0m0.006s
sys 0m0.373s
$ dd of=file.in oflag=nocache conv=notrunc,fdatasync count=0
$ time ./cp-after file.in /dev/shm/; rm /dev/shm/file.in
real 0m0.804s
user 0m0.007s
sys 0m0.405s
cheers,
Pádraig.