On Sat, 22 Jan 2005 04:20:57 +0900, Maarten Boonen <m44rt3n / yahoo.com> wrote:
> I am trying to compare a few algorithms, but there's a rather
> substantial difference in speed when I run a program like following 5
> times,
[snip]

5 times is not enough to tell how much time that average is spend in
the code.. it usually takes time to do setup/teardown, it can be
affected by the operating systems scheduler.

The average running time usually becomes visible by running it many times.. 
over and over.. try with 1000 times.. so that the program spends some seconds
in the code.

Tell me if it helps.
 
> I suspect this has to do with method caching. Is this correct? If so, is
> there a way to disable it? Or are there better ways of comparing?

I don't think such thing exists.  sorry.

--
Simon Strandgaard