title: Cocos2D 2.1 - High CPU usage while idle
body: <p>I have this iPhone app created in Cocos2d 2.1.</p>
  
  <p>WHen the app first starts it presents a full screen background and a UIACtionSheet where the user has to choose one option to start the application. That's it. This actionsheet is presented by the first scene to run by the delegate (HelloWorldLayer scene).</p>
  
  <p>Nothing else is loaded. Nothing is running on any thread that I am responsible for that. Even so, the CPU usage is about 20%. I have profiled that on instruments and this is what I have:</p>
  
  <p><img src="https://i.stack.imgur.com/MokLM.png" alt="enter image description here"> </p>
  
  <p>I see this [CCGLView swapBuffers] that is inside something that calls attention, ths <strong>CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION</strong> (CoreFoundation). </p>
  
  <p>If I choose "show obj-c only" I see this:</p>
  
  <p><img src="https://i.stack.imgur.com/tD9pL.png" alt="enter image description here"></p>
  
  <p>Apparently the guilty is this drawScene but how can a scene with a background image and a UIActionsheet use that much CPU?</p>
  
  <p>How do I trace the source of this problem?</p>
  
  <p>NOTE. This is being tested on the device. On simulator CPU usage is 77%!!!!!</p>