High-performance systems in Swift
summary
Claims that classes are faster than structs get dissected with concrete numbers and code: a naïve HTTPRequest struct copies cost ~52 ns versus an Int baseline much lower; moving all stored properties into a boxed heap object and using copy-on-write via isKnownUniquelyReferenced makes the struct passable in ~50 ns while preserving value semantics. Examples come from SwiftNIO work, show the boxed storage pattern, the small benchmark, and when to apply this optimization.
AI-written summary · about
chapters (5)
related talks
27mHigh Performance Systems in Swift
33mSwift at Scale: Where Performance Really Comes From
01h 00mThe Mysterious Swift Performance
28mUsability Meets Performance in Swift
34mSo You Think You Know Swift?
51mSwift 2 Under the Hood
47mAn Introduction to the Swift Programming Language
50mWrapping an OO API in a Functional Way
