High Performance Systems in Swift
summary
A Swift server that organizes lunches exhibits quadratic slowdowns because an unnecessary copy-on-write occurs per request, allocating a lot of memory (instruments shows ~2.3 GB from many contiguous array storage allocations, ~8,000 copies). Using Instruments allocations to inspect call stacks finds the COW path; fixes include removing the transient dictionary copy, generalized accessors (or tombstoning) and then the operation runs linear and fast.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 1:30Value Types
- 4:40Integers and Arrays
- 8:45Cows
- 11:25Live Demo
- 17:30Analysis
- 19:40The Problem








