Re: initialization time?
From: David B Ring (dbring_at_pacbell.net)
Date: 10/22/03
- Next message: Joona I Palaste: "Re: HELP needed - I'm a newbie Nevermind"
- Previous message: ge0rge: "Re: Apache + Tomcat integration - please help!"
- In reply to: Roedy Green: "Re: initialization time?"
- Next in thread: Roedy Green: "Re: initialization time?"
- Reply: Roedy Green: "Re: initialization time?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Next message: Joona I Palaste: "Re: HELP needed - I'm a newbie Nevermind"
- Previous message: ge0rge: "Re: Apache + Tomcat integration - please help!"
- In reply to: Roedy Green: "Re: initialization time?"
- Next in thread: Roedy Green: "Re: initialization time?"
- Reply: Roedy Green: "Re: initialization time?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|