altering bytecodePrimAdd & friends

Andreas Raab andreas.raab at gmx.de
Wed Aug 13 20:49:15 UTC 2003


Hi,

> Ok, I noticed that in bytecodePrimAdd once we decide both objects  
> aren't SmallIntegers we attempt to do a floating point add.
> Now it seems if you think about it why not consider the fact
> that the values could be LargeIntegers in the range 2^31 or so.

Because the chances of running into a float add are (I think) higher than
that of running into an "almost large integer" addition.

> Thus
> Time millisecondsToRun: [ | start |
> 	start _ SmallInteger maxVal + 1.
> 	1 to: 1000000 do: [:i | value _ start + i]]
> 
> 
> This takes 7,423 ms normally
> Now takes 919 ms with change

I'm not sure how valid this nano-benchmark is (I find myself having a hard
time even calling this a "micro" benchmark ;) Do you have any ideas how
often this would actually appear when we do something like the
macroBenchmarks? This exercises large parts of the system (except from FPU
performance) so if there are a significant number of "almost large integer"
additions we should see them.

Cheers,
  - Andreas



More information about the Squeak-dev mailing list