)entity {
BOOL shouldProcessAllFormats = NO;
if ([formatFamily isEqualToString:XXImageFormatFamilyUserThumbnails]) {
XXUser *user = (XXUser *)entity;
shouldProcessAllFormats = user.active;
}
return shouldProcessAllFormats;
}
```
The advantage of processing all image formats in a family at once is that the source image does not need to be repeatedly downloaded (or loaded into memory if cached on disk).
For example, if a user changes their profile photo, it probably makes sense to process the new source image for every variant at the same time that the first image format is processed. That is, if the image cache is processing a new user profile photo for the image format named `XXImageFormatNameUserThumbnailSmall`, then it makes sense to also process and store new image data for that same user for the image format named `XXImageFormatNameUserThumbnailMedium`.
## Documentation
Fast Image Cache's header files are fully documented, and [appledoc](http://gentlebytes.com/appledoc/) can be used to generate documentation in various forms, including HTML and Xcode DocSet.
HTML documentation can be [found here](https://s3.amazonaws.com/fast-image-cache/documentation/index.html).
## Demo Application
Included with this repository is a demo app Xcode project. It demonstrates the difference between the conventional approach for loading and displaying images and the Fast Image Cache approach. See the [requirements for running the demo app Xcode project](#requirements).
> **Note**: The demo application must either be supplied with JPEG images, or the included [`fetch_demo_images.sh`](./FastImageCache/FastImageCacheDemo/fetch_demo_images.sh) script in the [`FastImageCacheDemo`](./FastImageCache/FastImageCacheDemo) directory must be run.
### Video
> **Note**: In this demo video, the first demonstrated method is the conventional approach. The second method is using image tables.
### Statistics
The following statistics were measured from a run of the demo application:
| Method | Scrolling Performance | Disk Usage | [RPRVT](http://www.mikeash.com/pyblog/friday-qa-2009-06-19-mac-os-x-process-memory-statistics.html)1
| ---------------- |:-----------------------:|:------------:|:-----------------------------:|
| Conventional | `~35FPS` | `568KB` | `2.40MB`: `1.06MB` + `1.34MB` |
| Fast Image Cache | `~59FPS` | `2.2MB` | `1.15MB`: `1.06MB` + `0.09MB` |
The takeaway is that Fast Image Cache sacrifices disk usage to achieve a faster framerate and overall less memory usage.
---
1 The first value is the the total RPRVT used by a method to display a screen's worth of JPEG thumbnails. The second value is the baseline RPRVT where all the table view cells and image views are on screen, but none of the image views have images set. The third value is how much additional RPRVT each method used beyond the baseline.
## Contributors
**Mallory Paine** — Author and Original API Design
@mallorypaine
---
**Michael Potter** — Documentation and API Refactoring
@LucasTizma
## Credits
- All [demo application](#demo-application) photos were taken from [morgueFile](http://www.morguefile.com) and are used according to the [morgueFile license](http://www.morguefile.com/license/full).
- Fast Image Cache logo illustration by the amazing [Jake Mix](https://twitter.com/jakemix).
## License
Fast Image Cache is made available under the [MIT license](http://opensource.org/licenses/MIT):
The MIT License (MIT)
Copyright (c) 2013 Path, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.