cocos2d performance tips
1.
        nonatomic               !!




@property(nonatomic,assign) float altitude;
2.                         NSMutableArray
 NSArray                  CCArray




                          enumerator

     for ( CellObject *object in objects ) {
       ...
     }
cocos2d          ( 0.9.x   )
CC_ARRAY_FOREACH

CellObject *object;
CC_ARRAY_FOREACH(objects,object) {
  ...
}
for

for ( int i = 0;i < self.numObjects; i++ ) {
... hoge[i]
}

           indexOfObject
3.




     float




            count   length
4. float       double



          float     32bit
     double      64bit
                   100
5.




break
6.           tips




2   (x1,y1),(x2,y2)
float xd = endpoint.x - startpoint.x;
float yd = endpoint.y - endpoint.y;
float comparedist = 100 * 100;
distance = xd * xd + yd * yd;

if (distance > comparedist) {
...
}
sqrt
http://en.wikipedia.org/wiki/Fast_inverse_square_root


            float fast_sqrt(float number) {
            	

 	

 long i;
            	

 	

 float x, y;
            	

 	

 const float f = 1.5f;

            	

   	

   x = number * 0.5f;
            	

   	

   y = number;
            	

   	

   i = *(long*) &y;
            	

   	

   i = 0x5f3759df - ( i >> 1 );
            	

   	

   y = *(float*) &i;
            	

   	

   y = y * ( f - ( x * y * y ) );
            	

   	

   y = y * ( f - ( x * y * y ) );
            	

   	

   return number * y;
            }
http://iphonedevelopment.blogspot.com/2009/03/speed-with-
                       catch.html

 iPhone   InvSqrt


                                   Normalize
7.
RELEASE
Challenge optimizing your code!!

Cocos2d Performance Tips