Use access() instead of stat() when possible
We were using the stat() system call in quite a few places when we didn't
actually need anything the stat struct returned- we were simply checking for
file existence. access() will be more efficient in those cases.
Before (strace pacman -Ss pacman):
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
33.16 0.005987 0 19016 stat64
After:
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
34.85 0.003863 0 12633 1 access
7.95 0.000881 0 6391 7 stat64
Signed-off-by: Dan McGee <dan@archlinux.org>
0 files changed, 0 insertions, 0 deletions