Re: What is the purpose of static typing?
Re: What is the purpose of static typing?
- Subject: Re: What is the purpose of static typing?
- From: Marcel Weiher <email@hidden>
- Date: Thu, 25 Jul 2002 15:18:45 +0200
On Thursday, July 25, 2002, at 02:13 Uhr, Philip George wrote:
Okay, so I got rid of the threads and I setup two buttons.
Doesn't make much of a difference.
One button
draws the 'id' window and logs the start and end. The other does the
same but for the statically typed window. Here are the results (ALL of
the results) with the difference in creation/draw time under each set of
log statements:
Did you try it in the reverse order? First the "statically typed"
window and then the "id" window? What's the code like?
I realize this is a rather crude benchmark,
It really isn't a benchmark at all, at least not of message sending.
Just the display routines alone are going to take orders of magnitude
more time than message-sending. Once again, total message sending time
for your little example is not going to exceed 10 *micro*seconds even on
the slowest machine supported by OS X. The differences you are seeing
are (if I interpret the numbers correctly) several hundred
*milli*seconds. That is 4 orders of magnitude (a factor over over
10000). Just to put that into perspective, the relations are like that
between a single second and several hours.
What you are measuring has *nothing* to do with message send speeds.
but it still illustrates my
point: extra time is required to handle dynamically-typed objects at
runtime.
Nope. Once again (1) such a difference doesn't exist and (2) you are
measuring something else entirely.
Note that the 'id' window didn't beat the statically-typed window even
once. They came close sometimes, but static typing always won.
Once again, this has nothing to do with static typing.
Usually you wouldn't notice, because it might just be a couple little
objects, but I am talking about when you mass produce objects as id.
50 objects or message sends is not a "mass". This sort of stuff only
becomes reliably measurable when you have tens or hundresd of *millions*
of message sends.
Marcel
--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.