[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.
Cheers,
Marcel
--
Marcel Weiher Metaobject Software Technologies
marcel@metaobject.com www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
1d480c25f397c4786386135f8e8938e4
- Re: Gnustep usability, (continued)
- Re: Gnustep usability, Rogelio Serrano, 2004/08/07
- Re: Objective-C and Smalltalk; speed of message send, Marcel Weiher, 2004/08/10
- Re: Objective-C and Smalltalk; speed of message send, Richard Frith-Macdonald, 2004/08/10
- Re: Objective-C and Smalltalk; speed of message send, Alexander Malmberg, 2004/08/10
- Re: Objective-C and Smalltalk; speed of message send, Adrian Robert, 2004/08/10
- Re: Objective-C and Smalltalk; speed of message send, Alexander Malmberg, 2004/08/10
- Re: Objective-C and Smalltalk; speed of message send, Richard Frith-Macdonald, 2004/08/10
- Re: Objective-C and Smalltalk; speed of message send,
Marcel Weiher <=
Re: Gnustep usability, Jonathan Shipley, 2004/08/09