Seen java -server optimization vary 50%?

From: Don Taylor (dont_at_agora.rdrop.com)
Date: 02/26/05


Date: Sat, 26 Feb 2005 00:31:24 -0600

Hotspot 1.4.1-01 running as java -server appname
running on a 2+ghz AMD part 512 meg of memory,
installed straight off th Knoppix 3.2/Debian CD,
no other users, no other activity, no networking,
just run this from the command line and do println().

Wrote some code that gets an expression from the user and then
beats itself to death doing bigInteger multiply, mod, gcd, etc.

I time and print this every hundred iterations.

The odd part, every hundred iterations of a run will take the
same time to better than 1/2% accuracy. But if I kill it and
start it over the time can be substantially different, but
still each hundred is the same to better than 1/2%. These
hundred iterations can take anywhere from ten to fifteen
minutes, depending on the run. Not recompiling between the
runs, doing nothing but killing it and starting it over.
What I do now is run and kill a few times, until I get one
of the faster times, and then leave it running for days.

Ever seen anything like this? The only thing I can imagine
is that the runtime optimizer is doing a better or worse job
for some unknown reason, at startup, and then not changing
it when the thousands of iterations follow.

Any idea how I might get it to choose the fast time every time?
Thanks



Relevant Pages

  • Re: Seen java -server optimization vary 50%?
    ... >> I time and print this every hundred iterations. ... >> kill it and start it over the time can be substantially ... >whose most frequently executed loops do a lot of accesses to ... >for an explanation of some important indexing approaches. ...
    (comp.lang.java.help)
  • Re: Seen java -server optimization vary 50%?
    ... > just run this from the command line and do println. ... > I time and print this every hundred iterations. ... > What I do now is run and kill a few times, ... garbage collector can run at any time, ...
    (comp.lang.java.help)
  • Re: Seen java -server optimization vary 50%?
    ... >> I time and print this every hundred iterations. ... cycles would vary more. ... But if I kill this and restart it I can easily discover the next ... That does not sound like the garbage collector to me. ...
    (comp.lang.java.help)