I think a lot of these functions are implemented in hardware, so making interpreted software variants may not help. -- Kawigi Yeah, square roots should be handled in the math units in your processor. I recall reading somewhere they took about 60-70 cycles on a Pentium II era processor (don't have a source for this), which is slow for hardware, but still blowing away anything you'll ever do in software. This means picking a faster algorithm helps jack all if you're moving it from a one-step in pure hardware to a series of math calls in a software virtual machine :p If this were C or something then we could probably still talk, but in java I think this is just go-kart effect that traps some developers (oo.. I wrote a faster algorithm I can save cycles.. uh.. let's discount the fact that I'm probably spending the 70 cycles the original took in overhead for the while statement on it's own). -- Kuuran
|