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.
Showing
- doc/html/team.shtml 2 additions, 1 deletiondoc/html/team.shtml
- src/common/uid.c 35 additions, 0 deletionssrc/common/uid.c
- src/common/uid.h 5 additions, 0 deletionssrc/common/uid.h
- src/squeue/print.c 1 addition, 3 deletionssrc/squeue/print.c
- src/squeue/sort.c 4 additions, 8 deletionssrc/squeue/sort.c
Loading
Please register or sign in to comment