In this book, we show how to write very efficient Swift collection code. Throughout the book, we benchmark everything — with some surprising results. We implement custom data structures with value semantics and copy-on-write behavior such as sorted arrays, binary trees, red-black trees, and B-trees.
Even if you never implement your own collections, this book helps you reason about the performance of Swift code.
Update Notice — We’ll be updating the book for Swift 4.0 later this year. If you buy the Ebook now, or have bought it in the past, you’ll get the update for free when it’s available.
What’s in the book
Learn how Swift’s built-in collections perform
Use benchmarking to measure performance in the real world
Implement high-performance value types using copy-on-write
Wrapping Built-In Datatypes
NSOrderedSetto give it value semantics and copy-on-write performance
Build red-black search trees using algebraic datatypes
Implement the data structure behind many file systems and databases
Formats & Extras