Jump to ratings and reviews
Rate this book

Optimizing Collections

Rate this book
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.

152 pages, ebook

First published June 2, 2017

15 people want to read

About the author

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
7 (43%)
4 stars
6 (37%)
3 stars
3 (18%)
2 stars
0 (0%)
1 star
0 (0%)
Displaying 1 - 2 of 2 reviews
Profile Image for Stefan Kanev.
125 reviews242 followers
September 3, 2019
This is a fun book.

It's relatively short (roughly 170 pages on the iPad mini) and essentially walks you through a bunch of implementations of a sorted set in Swift. In the meantime, you learn about doing Copy on Write, Red-Black Trees, B-Trees and random chunks of Swift, algorithms and performance optimizations. It goes beyond nailing the asymptotic type and does some nice micro-optimizations that can help you learn about features of Swift that you might not be using. You won't end up with a lot of practical skills acquired from this book, but it is cool and enjoyable to read. If you don't know about Red-Black Trees and B-Trees, this is definitely a good place to learn a bit.

On the down side, it lacks a bit of completeness – it covers only inserting in trees, but not removing or the other operations (where it can get quite interesting). Still, it's great for such a short book.
Profile Image for Jp.
309 reviews5 followers
January 20, 2018
Solid, well-researched, and clear. Another stellar example from objc.
Displaying 1 - 2 of 2 reviews

Can't find what you're looking for?

Get help and learn more about the design.