<snip>
Absolutely no offence intended but ... it's not so much that it's not a
fair test,
rather it is a really bad benchmark.
I ran the ObjC benchmark on my system, and found that it reported about
290,000 function calls per second and about 1,600,000 method sends
per second ... since it's obviously ridiculous to say that a method
send is
three times as fast as a function call, I looked at the code with a
bit
of care ...
In the first place, the output messages saying calls/sec or sends/sec
are not
telling the truth, as the benchmark is not measuring calls or sends
per
second.
In the second place, once you have realised that the the benchmark is
not
measuring what it says, you then have to realise that it's not really
measuring
anything meaningful at all. What it is actually doing is finding the
smallest
fibonacci number that it takes a second or more to calculate, *then*
it
is
adjusting that number in proportion to the time actually taken,
presumably
in an attempt to normalise it to the second in some way.
However, since fibonacci numbers are non-linear, the result actually
varies
in ways which are too horrible to attempt to work out. One extra call
will
increase the result by roughly 50%, while depending on the actual time
taken, the final adjustment can leave the result unchanged or halve
it,
and these two fluctuations are unlinked.
I changed the code to print out the input to the fib function and the
time
actually taken .. which gives you a more reasonable idea of
performance.
As you can see, the extra information makes it clear that function
calls
are significantly faster than method sends, and the original output
values are bogus.