• 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: Should I do loops in reverse order ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Should I do loops in reverse order ?


  • Subject: Re: Should I do loops in reverse order ?
  • From: Bill Bumgarner <email@hidden>
  • Date: Tue, 28 Nov 2006 00:48:03 -0800

And while we are second guessing the compiler, let us not forget manual loop unrolling. Just be careful to use the various performance analysis tools to determine the optimal number of "unrolled iterations". And you'll want to use a bunch of #ifdefs to ensure that you are per-architecture optimal, too....

id o;

o = [myArray objectAtIndex: 0];
... do something ...
o = [myArray objectAtIndex: 1];
... do something ...
o = [myArray objectAtIndex: 2];
... do something ...
o = [myArray objectAtIndex: 3];
... do something ...
o = [myArray objectAtIndex: 4];
... do something ...
o = [myArray objectAtIndex: 5];
... do something ...

if ([myArray count] > 6) {
	for(i=6;..) {
		... do something ...
	}
}

b.bum

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Should I do loops in reverse order ? (From: Martin <email@hidden>)
 >Re: Should I do loops in reverse order ? (From: Shawn Erickson <email@hidden>)

  • Prev by Date: Re: memory allocation and virtual memory increase
  • Next by Date: How to create a side drawer of fixed height
  • Previous by thread: Re: Should I do loops in reverse order ?
  • Next by thread: Re: Should I do loops in reverse order ?
  • Index(es):
    • Date
    • Thread