execution timing and time(1)

chris at umcp-cs.UUCP chris at umcp-cs.UUCP
Sun Aug 10 15:42:34 AEST 1986


In article <1200016 at iuvax.UUCP> jec at iuvax.UUCP writes:
>Could some one please fill me in on what could account for the
>variations in timing?

Without knowing the actual system and program involved, I cannot
say for certain, but it is likely that all of the variation you
have observed is due to cacheing.  Assuming you are on a Vax, there
are two hardware caches to consider (`the cache' and the TLB), and
if you do any disk I/O you are also using the Unix buffer cache.
If your machine is low on memory you may experiene paging effects;
and if not, the first run will take a bit more time to load the
executable into memory.  Subsequent runs will reclaim the pages
without any disk reads.

Then, too, there is the fact that the timing statistics are gathered
with a 100 hz clock which is synchronised with hardware clock
interrupts, which does not help any.  For statistics-gathering
without extra hardware, the best course seems to be to produce
long-term averages under various conditions.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1516)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at mimsy.umd.edu



More information about the Comp.unix.wizards mailing list