From: Ryan Davis Date: 2011-08-18T06:25:19+09:00 Subject: Re: Strangely slow float to int and int to float conversion 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 > > 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 > > 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.