FastImageCache – iOS library for quickly displaying images while scrolling
github.com
github.com
This technique is used on the iOS home screen - both the icon images and the rendered icon labels are stored as uncompressed bitmaps on disk and mmap'd when needed into memory. The fast loading allows SpringBoard to aggressively recycle icon views.
FIC really pays off in a scenario like Path's mobile app. We have many, many small-to-medium-size user images to display, and those images are competing for CPU time with all of the styled text labels we're drawing. The less CPU we have to devote to images, the faster we'll be able to scroll.
Well, Path is amazingly smooth for how much styled stuff is in it, so nice work :) The UI really does stand out in how well it's done.
We didn't go the route of caching the uncompressed data on disk, though, we just keep the images in a maintained in-memory cache.
Even on the 5 I was surprised by how much it helped to have the images cached (no anecdotal data on the 5S as it came out way after we started caching)
One trouble now is you never know if a library or whatnot will be ARC so it fragments things somewhat.
Overall, yes, it's less smooth to include non-ARC code in an ARC project.
-fobj-arc
and -fno-objc-arc
are handy ways to manage ARC and non-ARC files in your projects, depending on what your yen for -retain and -release are.I've since lost track of the Apple documentation that said it, but CA prefers 16-byte alignment and (kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little) for the pixel format.