NewEra performance difference between base types and object types
Posted in 1996
Should you use base type (INTEGER, DECIMAL, etc) or the object type (ixInteger, ixDecimal, etc)? Which is faster? I ran the following test and the results surprised me. The object version took .5 seconds and the base version took 15 seconds. I also tried mult, div, plus, etc. and the difference is not as impressive but it is still better. ------------------------------------------- include system "ixNum.4gh" main variable anInt1 ixInteger(0) variable anInt2 integer = 0 variable aCount integer display "start" sleep 3 -- dummy loop to see cost of for loop display current hour to fraction(2) for aCount = 1 to 10000 end for -- use object type display current hour to fraction(2) for aCount = 1 to 10000 call anInt1.inc() end for -- use base type display current hour to fraction(2) for aCount = 1 to 10000 let anInt2 = anInt2 +1 end for display "finish ",current hour to fraction(2) return end main ----------------------------------------- David W Chan GO5 Limited dwc@cix.compulink.co.uk