[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C and Smalltalk; speed of message send

From: Marcel Weiher
Subject: Re: Objective-C and Smalltalk; speed of message send
Date: Tue, 10 Aug 2004 22:56:14 +0100

Apart from what Richard said, it seems you are primarily measuring the speed of the getrusage() system call that clock() tends to be based on...

Actually no ... if you examine the code carefully, you will see that clock() is used to time operations (one call to clock() before the operation and one call after), but that the only operation actually used for presenting a result is the fist one which takes over a second to execute ... so the execution time of clock() is insignificant.

Ahh, yes, you're right, of course. "Please engage brain before putting mouth into gear". Fortunately, I hedged with "seems" ;-)

Actual message passing speed for a constant receiver is around 50 ns on 1 Ghz G4, with a third of that going to inter-module calling overhead. So around 20 million message sends per second. Squeak on the same system is significantly slower.

That's interesting.
Is that with the apple or gnu runtime?

Apple runtime.

Is that repeated uses of the same message to objects of the same class?

Yes, constant receiver and constant message as well.

I ask because the apple runtime caches those and is much faster if you benchmark that than if you benchmark against a large variety of different methods.

Yes, though the method cache tends to be pretty effective, and they also have further caching in the classes themselves, so primary cache failure apparently does not mean a full table-walk. Though I have to admit that I always found those parts somewhat obscure.



Marcel Weiher                           Metaobject Software Technologies
address@hidden          www.metaobject.com
Metaprogramming for the Graphic Arts.   HOM, IDEAs, MetaAd etc.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]