Updated for Swift 4
Optimizing Collections
Write custom collections in Swift with a strong focus on performance
by Károly Lőrentey
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.
Book Contents
-
Swift Collections
Learn how Swift's built-in collections perform
-
Performance
Use benchmarking to measure performance in the real world
-
Copy-On-Write
Implement high-performance value types using copy-on-write
-
Wrapping Built-In Datatypes
Wrap
NSOrderedSet
to give it value semantics and copy-on-write performance -
Red-Black Trees
Build red-black search trees using algebraic datatypes
-
B-Trees
Implement the data structure behind many file systems and databases
Formats & Extras
-
Code
-
Mac Playgrounds (full text)
-
Written in Swift 4
-
-
Ebook
-
150-page PDF
-
ePub
-
Buy Book
Bundles
Save on each additional book
About the Author
-
Károly Lőrentey
Károly Lőrentey is a freelancer who spends his days and nights on crafting elaborate open-source Swift frameworks instead of working on his apps.
FAQ
-
Is the book updated for Swift 4?
Yes!
-
Will you update the book?
Yes. For more information on our policy, see book updates.
-
Do you offer student discounts?
Yes, please email us and let us know what and where you're studying.
-
Can I get a “reverse charge” invoice without VAT?
Just click the "Generate Invoice" link in the receipt email and fill out your company data to get a VAT refund.
Updates
-
November 2017
Updated for Swift 4
-
June 2017
Initial release (Swift 3)
-
March, 2017
Early Access