Reducing system calls overhead

Jack Jansen jack at cwi.nl
Fri Aug 26 22:45:31 AEST 1988


I don't think that the solution you pose for simple calls would
help anything. First, calls like getuid, getpid, etc. are very
rare, and, second, there's a much simpler solution for these calls:
just do the call the first time and cache the result.

For getpid() you would need some help from fork/vfork, but nothing
undoable.
This would get the same results, and even cheaper.

Now, two calls that *would* benefit from optimization are stat() and
ioctl().
>From some system call traces I've seen it showed that these calls
are done incredibly often: stat() by programs that first check
modes before they create a file; and ioctl() by all sorts of
shells, etc. that have command line editing.

Unfortunately the quick-entry system doesn't work here because both
these calls can block....

	Jack Jansen, jack at cwi.nl (or jack at mcvax.uucp)
	The shell is my oyster.



More information about the Comp.unix.wizards mailing list