Image performance
summary
Decoding time dwarfs file-load time: a decoded image always uses decoded size = width × height × 4 bytes (a raw iPhone 5s photo can be ~30 MB decoded), so avoid many simultaneously decoded images. Bundled images via imageNamed caches decoded images; disk loads use NSCache for runtime caching. JPEG2000 decompresses very slowly; use JPEG for photos, PNG for small UI art, or generate thumbnails with CGImageSourceCreateThumbnailAtIndex to decode/scaled images off the main thread. PVRTC textures (e.g. a 4096² image reduced from ~64 MB to ~4 MB) remove decoding but require an OpenGL pipeline. Use hybrid (JPEG color + PNG mask) or raw BGRA caching only when necessary.
AI-written summary · about
