Commit 675bbc8d authored by Anders Halager's avatar Anders Halager Committed by jette
Browse files

Added simple uid cache to squeue

squeue has to convert uid_t to a char* username a lot. Every line of
output(with the default format) and for every comparison when sorting by
username. This causes multiple system calls to open and read /etc/passwd
on standard systems and on my system running YP there were 17
unnecessary entries in strace per line in the output.

The cache is very simple, just a sorted array that is resorted for every
new name. The number of unique usernames is likely going to be so low
that any machine can handle it. No attempt is made at freeing memory for
the same reason.
parent d8f8141c
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment