procps/ps
Stephen Brennan 518547742b Set TZ to avoid repeated stat("/etc/localtime")
With glibc, each time the strftime() function is used (twice per process
in a typical ps -fe run), a stat("/etc/localtime") system call is used
to determine the timezone. Not only does this add extra system call
overhead, but when multiple ps processes are trying to access this
file (or multiple glibc programs using strftime) in parallel, this can
trigger significant lock contention within the OS kernel.

Since ps is not intended to run for long periods of time as a
daemon (during which the system timezone could be altered and PS might
reasonably be expected to adapt its output), there is no benefit to
repeatedly doing this stat(). To stop this behavior, explicitly set the
TZ variable to its default value (:/etc/localtime) whenever it is unset.
glibc will then cache the stat() result.
2020-12-22 11:09:44 +11:00
..
common.h library: make that 'escape_str' private to our library 2020-07-05 21:13:01 +10:00
COPYING
display.c Set TZ to avoid repeated stat("/etc/localtime") 2020-12-22 11:09:44 +11:00
global.c
HACKING
help.c
output.c library: make that 'escape_str' private to our library 2020-07-05 21:13:01 +10:00
parser.c
ps.1 docs: some manpage fixes 2020-06-04 22:33:16 +10:00
regression
select.c ps: Match on truncated 16 char for -C 2020-09-24 22:19:11 +10:00
sortformat.c
stacktrace.c