On Aug 17, 2011, at 13:55 , Petr Kovar wrote:

> 3_000_000 times simple int to float conversion is more then 10 times
> slower than float to int
> float to int...0.404731428s
> int to float...4.803439434s
>=20
> 30_000_000 times int to float is 100 times slower than float to int
> float to int...4.057228206
> int to float...405.354131022
>=20
> so 10 times more operations but it's 100 times slower!

small ints are stored _in_ the VALUE pointer so there is no extra =
allocation necessary.

floats aren't, so every one you make will be a malloc and set and then =
that space will be GC'd eventually.

You're prolly seeing the increase in multiplier by invoking the GC more. =
Run on a system with a lot of memory and turn off GC to verify.