Re: gettimeofday() a special case : why?

Stephen C. Tweedie (sct@redhat.com)
Mon, 13 Dec 1999 13:26:12 +0000 (GMT)


Hi,

On Mon, 13 Dec 1999 02:18:42 -0500, salkin@mindspring.com said:

> I don't want to be too OT or bothersome, but can someone explain why
> gettimeofday() is the one syscall that optimization at the ~100 cycle
> level makes sense for?

A lot of server applications need to do timeout processing on all of
their connections. That requires knowning the current time any time you
are processing IO.

zmailer shows this very well: they went to the extent of setting up a
shared memory segment to hold the current time, incrementing it on a
timer signal and sharing that timer amongst all the mailer processes.
That saved them one syscall per IO loop and gave a measurable
performance boost.

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/