altering bytecodePrimAdd & friends

John M McIntosh johnmci at smalltalkconsulting.com
Thu Aug 14 04:36:33 UTC 2003


On Wednesday, August 13, 2003, at 01:49  PM, Andreas Raab wrote:
>> 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?

macro benchmarks

48,885,673 Total calls to bytecode primitive add
43,238,880 Pure Small integers
5,646,773 were float related
3,238,009  Add fail so resort to sending #+ (wonder what they are?)
  8 were large integer  1GB < 2GB addition resulting in a SmallInteger
12 were large integer 1GB < 2GB resulting in large integer 1GB < 2GB.

However my tuning attempt here was really to make math in the +-2GB  
boundaries as fast as SmallInteger math.

Mostly since many algorithms work in the bounds defined by 32bit 2s  
complement math so it's
not unusual for some Squeaker to do these types of calculations.

MMm given either a (SmallInteger,Float,LargeInteger) against a  
(SmallInteger,Float,LargeInteger) it
would be nice to be able to dispatch directly to the code that knows  
how to do the addition, versus having
to check types again and again. A computed goto comes to mind, but how  
would you do that in slang...


--
======================================================================== 
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
======================================================================== 
===



More information about the Squeak-dev mailing list