Re: loop efficiency & messages
Re: loop efficiency & messages
- Subject: Re: loop efficiency & messages
- From: Hamish Allan <email@hidden>
- Date: Tue, 22 Mar 2005 22:04:03 +0000
hehe. Yes, that is what I wanted to ask. The compiler certainly
couldn't infer from that code whether or not the destination of the
message will remain constant throughout the loop. However, I could
imagine this would be a desirable feature. I think MuleKybernetic (?)
had an article on "selector caching", or such, that discussed how to
solve this particular problem. I dunno if I'd consider their technique
a compile-time feature however.
It seems to me that there's a really easy way to signal to the compiler
to cache the result of the getCount in a register:
int count = [self getCount];
for (i = 0; i < count; ++i)
...
Best wishes,
Hamish
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden