]> git.ipfire.org Git - thirdparty/coreutils.git/commit
Improve performance a bit by optimizing away
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 24 Nov 2005 06:49:44 +0000 (06:49 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 24 Nov 2005 06:49:44 +0000 (06:49 +0000)
commit25719a33154f0c62ea9881f0c79ae312dd4cec7a
tree2c14907818df8823ead58a045d321111e406855f
parent757d7a8eb53c5d168efb2a3e2eaf482922ec469d
Improve performance a bit by optimizing away
unnecessary system calls and going to a block size of at least
8192 (on normal hosts, anyway).  This improved performance 5% on my
Debian stable host (2.4.27 kernel, x86, copying from root
ext3 file system to itself).
Include "buffer-lcm.h".
(copy_reg): Omit last argument.  All callers changed.
Use xmalloc to allocate rather than trusting alloca
(which is unwise with large block sizes).
Declare locals more locally, if possible.
Use uintptr_t words instead of int words, for a bit more speed
when looking for null blocks on 64-bit hosts.
Optimize away reads of zero bytes on regular files.
In the typical case, insist on 8 KiB buffers, at least.
Avoid unnecessary extra call to fstat when checking for sparse files.
Avoid now-unnecessary cast to off_t, and "0L".
Avoid unnecessary test of *new_dst when checking for same owner
and group.
src/copy.c