• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: loop efficiency & messages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: loop efficiency & messages
      • From: Marcel Weiher <email@hidden>
    • Re: loop efficiency & messages
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Re: loop efficiency & messages
  • Next by Date: Re: loop efficiency & messages
  • Previous by thread: Re: loop efficiency & messages
  • Next by thread: Re: loop efficiency & messages
  • Index(es):
    • Date
    • Thread