Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

System calls in zsh



Hello. I've been using zsh 3.0.0 on IRIX for a while here at work, and we
just started an evaluation of shell script efficiency that prompted me to
ask this. It seems that if you create an empty zsh script and run it, it
invokes these system calls (which I got using "par -s -S"):

exit             : 1 times
read             : 12 times
open             : 12 times
close            : 11 times
time             : 3 times
brk              : 5 times
getpid           : 5 times
getuid           : 5 times
access           : 1 times
syssgi           : 5 times
times            : 1 times
getgid           : 4 times
ioctl            : 8 times
sysmp            : 2 times
execve           : 1 times
fcntl            : 5 times
lseek64          : 1 times
sigreturn        : 1 times
gethostname      : 1 times
getdomainname    : 1 times
gettimeofday     : 1 times
prctl            : 1 times
mmap             : 2 times
getrlimit        : 8 times
xstat            : 5 times
fxstat           : 9 times
sigaction        : 3 times
ngetdents        : 3 times

Can anyone explain why read() and open() are called so many times for an
empty shell script? The Bourne and Korn shells here invoke them twice each.
zsh seems to be expending a bit more effort here than might be necessary.

--Nik



Messages sorted by: Reverse Date, Date, Thread, Author