[Bug 230491] stat(1): Improve performance with getpwuid() and getgrgid() caching

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Aug 11 02:47:05 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230491

--- Comment #11 from Conrad Meyer <cem at freebsd.org> ---
Here's my non-scientific results for my proposed patch (on CURRENT GENERIC,
i.e., WITNESS and INVARIANTS are on, which introduces wider error bars than
without, but still):

BEFORE
conrad at n /u/s/u/stat ❯❯❯ time (find /usr/src -type f -print0 | xargs -0 stat
>/dev/null)
( find /usr/src -type f -print0 | xargs -0 stat > /dev/null; )  3.62s user
5.23s system 102% cpu 8.655 total
conrad at n /u/s/u/stat ❯❯❯ time (find /usr/src -type f -print0 | xargs -0 stat
>/dev/null)
( find /usr/src -type f -print0 | xargs -0 stat > /dev/null; )  3.47s user
5.38s system 102% cpu 8.647 total

AFTER
conrad at n /u/s/u/stat ❯❯❯ time (find /usr/src -type f -print0 | xargs -0 $(make
-V .OBJDIR)/stat >/dev/null)
( find /usr/src -type f -print0 | xargs -0 $(make -V .OBJDIR)/stat > /dev/nul) 
1.23s user 1.81s system 108% cpu 2.810 total
conrad at n /u/s/u/stat ❯❯❯ time (find /usr/src -type f -print0 | xargs -0 $(make
-V .OBJDIR)/stat >/dev/null)
( find /usr/src -type f -print0 | xargs -0 $(make -V .OBJDIR)/stat > /dev/nul) 
1.43s user 1.54s system 107% cpu 2.754 total

(I gave both programs a throw-away warm-up run first to make sure the disk
caches were comparably primed, etc.)

Seems like a clear win.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list