13. I/O: Examples

Having looked at the performance characteristics of some of the I/O and serialization APIs in the previous chapter, we’ll now look at some practical examples of making I/O faster. Significantly faster.

We start out with a simple word list for a game and work our way up through Apple’s binary property list format, which we speed up significantly for many practical purposes. Finally, we throw in some fast comma-separated value (CSV) parsing and design a compact file format for public transport data that beats CoreData by orders of magnitude.

iPhone Game Dictionary

This particular quest was kicked off by a message from Miles on Apple’s cocoa-dev mailing list.1 Miles wanted to load about 2 MB of text as a dictionary of words for ...

Get iOS and macOS™ Performance Tuning: Cocoa®, Cocoa Touch®, Objective-C®, and Swift™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.