Integer micro-benchmarks [Smalltalk Multi-Precision Numerics vis-a-vis Hig

Dave Harris brangdon at cix.co.uk
Tue Apr 24 13:15:00 EDT 2001


pulsar at qks.com (David Simmons) wrote (abridged):
> I ran two different tests. The first one loops to generate "only"
> SmallInteger sums; the (900,000) loop. The second test is based on the
> originally posted sample and performs the 1,000,000 count loop; and 
> thus generates a significant number of large integers.

Does this mean SmallScript's SmallInteger range is smaller than 
Dolphin's? I tried to pick numbers that would give a long enough period 
to measure, but without overflowing the local SmallIntegers.

My loop was actually 10,000,000 iterations, ie 10 times the figures you 
say. The actual numbers shouldn't matter too much, as long as they are 
large enough to reduce timing error.


> NOTE: Use of GetTickCount() has rounding loss that can result in 
> reporting of times which are up to 20ms less than actual time.

On my machine, that would be an error of less than 2%, which I felt was 
insignificant.


> Dolphin Smalltalk Professional 4.01
>     12,086ms for loop over 900,000
>         36.404 : 1 Optimized C++ Ratio

I am surprised you got 36:1 here, because my machine was giving 16:1. I'm 
using 4.00, though.


> Cincom VisualWorks 5i3NC
>     1,457ms for loop over 900,000
>         4.3886 : 1 Optimized C++ Ratio

Thanks.


> SmallScript v4 AOS Platform VM
>     1,328ms for loop over 900,000
>         4.000 : 1 Optimized C++ Ratio

Impressive. Thanks for the results.


> I should also point out that this kind of test represents a 
> *worst-case* type of scenario for Smalltalk (dynamic/script
> language) performance (where it is handling arbitrary/multi-precision
> arithmetic) vis-a-vis statically typed and highly optimized C++
> code performing fixed size integer truncated arithmetic.

Yes; the idea was not to compare Smalltalk to fixed-size C++ code, but to 
some variable-sized C++ code. The fixed-size code just provides a 
baseline for measurements between different machines. I'm not sure it's 
working, though, as the Dolphin results vary so much.

  Dave Harris, Nottingham, UK | "Weave a circle round him thrice,
      brangdon at cix.co.uk      |   And close your eyes with holy dread,
                              |  For he on honey dew hath fed
 http://www.bhresearch.co.uk/ |   And drunk the milk of Paradise."



More information about the Python-list mailing list