Date: Thu, 6 Nov 1997 23:43:10 +0000 (GMT) From: Andrew Gordon <arg@arg1.demon.co.uk> To: Mike Smith <mike@smith.net.au> Cc: hackers@hub.freebsd.org Subject: Re: gettimeofday() overhead Message-ID: <Pine.BSF.3.91.971106233433.13457C-100000@server.arg.sj.co.uk> In-Reply-To: <199711041315.XAA00406@word.smith.net.au>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 4 Nov 1997, Mike Smith wrote: > OTOH, if +/- 1 second is good enough, a once-a-second timer and a local > call to gettimeofday() would be a simple and straightforward technique, > as was also suggested. But for the application which (IIRC) started this discussion - NATD, that might be worse overall. Since NAT is often used with dial-up links, and hence not used at all for long periods, the cost of keeping the daemon in core and servicing the 1Hz ticks when it has no useful work to do could well add up to more overall system load than the individual calls per packet - gettimeofday() is quite cheap. Of course you could keep flags such that you turn off the timer when there is nothing going on (traded against a small overhead in maintaining flags to know when this is), but this seems unduly complex for a rather minor gain.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.971106233433.13457C-100000>