Unexpected High CPU decoding a progressive JPEG

Originator:codesujal
Number:rdar://11738579 Date Originated:25-Jun-2012 10:55 AM
Status:Open Resolved:
Product:iPad SDK Product Version:5.1
Classification:Performance Reproducible:Always
 
Summary: Using UIImageView or CGImageCreateWithJPEGDataProvider to decode a large, progressively encoded JPEG takes much longer than expected with high CPU utilization

Steps to Reproduce:
Using a full screen progressively encoded JPEG for retina resolution on the iPad  is the easiest way to reproduce this issue. I have a test program available on Github that shows three different images getting decoded and displayed. The progressively encoded jpeg is marked.

https://github.com/sujal/Image-Tester

Build and Run the program on an iPad.

Expected Results: The time taken would be longer than a non-progressively encoded JPEG, but not orders of magnitude longer. For example, the baselines encoded JPEG takes around 100-200ms to decode. I would expect, based on my understanding the spec and progressive JPEGs at smaller sizes, that it might take 500-800ms.

Actual Results: My testing shows that it consistently takes 2-3 seconds at least.

Notes: I did not test at very granular sizes of images, but it *feels* like there's a size at which performance suddenly degrades. But, we only have handy images at certain sizes. I only see the issues with the full 2048x2048 jpegs.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!