[ODE] Re: dRandInt & performance

Jon Watte hplus-ode at mindcontrol.org
Mon May 16 10:58:36 MST 2005


> > On my PS2 build replacing dRandInt with a simple inline
> > custom randomInt function (see later) improved for me

> That said, it does quite unnecessary int->double->int computations,
> and is not inline.

"double" is not a native type on the PS2; emulation will drive the 
cost through the roof.

Even on x86, it's a bad idea, because double->int will typically 
cause a very expensive pipeline stall, because of the way compilers 
implement conformance with the standard C numerics library rules.

Cheers,

			/ h+




More information about the ODE mailing list