title: UIImageView displays MUCH faster than either CG or CALayer. Anyone know why?
body: <p>I've written an app to test image performance on iOS.  I've tried 3 different views, all displaying the same large PNG.  The first is a view that draws using CGContextDrawImage().  The second sets self.layer.content.  The third is a plain UIImageView.</p>
  
  <p>The image used is created using -[UIImage initWithContentsOfData:] and cached in the viewController.  Each test repeatedly allocs a view, adds it to the view hierarchy and then removes it and releases it.  Timings are taken from the start of loadView to viewDidAppear and given as fps (effectively, view draws per second).</p>
  
  <p>Here are the results from an iPad 1 running 5.1 using a 912 x 634 unscaled image:</p>
  
  <pre><code>CGContext:    11 fps
  CALayer:      10 fps
  UIImageView: 430 fps (!)
  </code></pre>
  
  <p>Am I hallucinating?  It seems almost impossible that UIImageView can draw that fast, but I can actually watch the images flicker.  I tried swapping between two similar views to defeat possible caching, but the frame rate was even higher.</p>
  
  <p>I had always assumed that UIImageView was just a wrapper for -[CALayer setContent].  However, profiling the UIImageView shows almost no time spent in any drawing method that I can identify.  </p>
  
  <p>I'd love to understand what's going on.  Any help would be most appreciated.</p>