@Stevie
Thanks. Still a long way to go to catch up with the dan-ball version however ;)
@Tachyon
You may well be correct. I think I'll have to do some testing to see if it does indeed speed it up at all. There seems to be a big penalty incurred when mixing types up (casting must be expensive).
e.g.
Adding float to int took 463 ms
Adding int to int took 3 ms
Adding float to float took 5 ms
Multiplying int with float took 471 ms
Multiplying float with float took 4 ms
Dividing int by int took 17 ms
Thanks. Still a long way to go to catch up with the dan-ball version however ;)
@Tachyon
You may well be correct. I think I'll have to do some testing to see if it does indeed speed it up at all. There seems to be a big penalty incurred when mixing types up (casting must be expensive).
e.g.
SuperStrict Const iterations:Int = 1000000 Local i:Int, ms:Int Local foo:Int= 0 Local baz:Int = 8 Local goo:Float = 0.0 Local bar:Float = 0.125 foo = 0 ms = MilliSecs() For i = 0 To iterations foo :+ bar Next Print "Adding float to int took "+(MilliSecs() - ms) +" ms" foo = 0 ms = MilliSecs() For i = 0 To iterations foo :+ baz Next Print "Adding int to int took "+(MilliSecs() - ms) +" ms" goo = 0.0 ms = MilliSecs() For i = 0 To iterations goo :+ bar Next Print "Adding float to float took "+(MilliSecs() - ms) +" ms" foo = 2000000 ms = MilliSecs() For i = 0 To iterations foo :* bar Next Print "Multiplying int with float took "+(MilliSecs() - ms) +" ms" goo = 2000000.0 ms = MilliSecs() For i = 0 To iterations goo :* bar Next Print "Multiplying float with float took "+(MilliSecs() - ms) +" ms" foo = 2000000 ms = MilliSecs() For i = 0 To iterations foo :/ baz Next Print "Dividing int by int took "+(MilliSecs() - ms) +" ms"
Adding float to int took 463 ms
Adding int to int took 3 ms
Adding float to float took 5 ms
Multiplying int with float took 471 ms
Multiplying float with float took 4 ms
Dividing int by int took 17 ms