Re: initialization time?

From: David B Ring (dbring_at_pacbell.net)
Date: 10/22/03


Date: Wed, 22 Oct 2003 21:04:11 GMT

I want a time that fairly represents one algorithm versus another, so
I've been taking the median of five iterations, which gives essentially
the same answer as throwing out the first two and averaging.

It does sound as if complex algorithms with more code to load and
optimize are likely more subject to slow first runs, and this may bear
on their real world performance if lists are sorted occasionally and one
at a time.

Regarding your first response, there's no way to guarantee that gc()
happens before a block of code is executed?

Dave

Roedy Green wrote:
> On Wed, 22 Oct 2003 19:38:39 GMT, David B Ring <dbring@pacbell.net>
> wrote or quoted :
>
>
>>Is there a
>>way to force this to happen beforehand, so that it does not distort the
>>sorting times?
>
>
> Several things make code gradually speed up.
>
> 1. classes don't have to be reloaded.
>
> 2. hotspot gets smarter with more observation, and more native code.
>
> 3. your code floats into real ram pushing out other applications.
>
> What are you trying to measure -- the fastest possible time, the time
> you can expect after a number of uses, time to expect if you use only
> once? For a server situation, just throw away the first few
> iterations, and average the rest.
>
> --
> Canadian Mind Products, Roedy Green.
> Coaching, problem solving, economical contract programming.
> See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.



Relevant Pages

  • Inaccuracy of ANSI clock() as ?-RNG
    ... I tried to build a portable ANSI C stopwatch with sub-/millisecond ... accuracy, using the clock-function. ... Inaccuracy is reflected as a varying number of iterations which fit ... "Juuso's inaccurate clock" - algorithm. ...
    (sci.crypt)
  • Re: Finding the Formula...
    ... algorithm for generating the coefficients. ... how you said it took many many iterations with huge matrices to ... If my "hunch" is right and the polynomials are of degree n, ...
    (sci.math)
  • Re: results too good?
    ... Artificial neural networks are not a random process. ... Use 7-fold cross-validation where regression MSE or classification ... Repeating this whole algorithm repeatedly ... increased averaging smoothen my line even more? ...
    (comp.soft-sys.matlab)
  • Re: which stopping rule should I use for my algorithm
    ... I have made an iterative algorithm for minimizing a multivariate ... > 'intTol' iterations, stop. ... > the we will have premature termination for smaller data sizes. ...
    (comp.soft-sys.matlab)
  • Re: Analysis of gas mode MM interferometer operation using standard SR formulae.
    ... turn averaging procedure does absolutely nothing to reveal the ... So I would say the full algorithm with the averaging is fairly ... any significant excess over its expected level? ... ALWAYS results in a periodic half-rotation curve, ...
    (sci.physics.relativity)