With all current optimizations[1] I now have these timings:

$ ./bench -b=^oo[234f]
Numbers are relative to the first one. (lower is better)
        p-j-Oc  perl-th perl    python  ruby
oo2     100%    182%    152%    90%     132%
oo3     100%    276%    256%    333%    383%
oo4     100%    137%    128%    171%    292%
oofib   100%    303%    261%    157%    161%

And
$ time CALL__BUILD=1  parrot -j oo2b.pasm
real    0m2.566s
vs      0m2.630s  for oo2.pasm
(w.o any of these optimizations oo2b takes 3.9s)

oo2 is basically object instantiation, oo2b calls the method in the BUILD property, oo2 calls __init directly.
oo3 is attribute get
oo4 is attribute set (where Parrot creates new PMCs, which isn't really needed :)
oofib tests mostly function/method call speed


[1]
- set_string_native references the string
- constant strings e.g. "BUILD" get a precomputed hash value from c2str.pl
- use of _S("BUILD") and _S("CONSTRUCT") in objects.c

Athlon 800
Parrot -O3 (gcc 2.92.2)
perl-th is threaded 5.8
perl is 5.8 with long double support
python 2.3.3
ruby 1.8.0



Reply via email to