Slow Swift
summary
Work on CryptoSwift and ObjectivePGP shows compiled Swift is fast but the REPL and debug builds are extremely slow — 500–1000× slower in practice — so always benchmark optimized builds. Compiler pain points: a single function once took 60s → <1s to compile after removing bit shifts; generics benefit from specialization (example: unspecialized generic method 20ms versus 20ms → 0.06ms when specialized). Use -O/-Owholemodule, reserveCapacity to avoid reallocations, prefer inout for heavy mutations, and consider disabling runtime safety checks when safe.
AI-written summary · about
chapters (11)
- 0:00Intro
- 0:36Marcin Krzyżanowski
- 2:42Why Swift?
- 4:02Script Swift?
- 5:21Compiled Swift
- 8:07Compilation
- 12:06Source Optimization
- 21:34Memory
- 27:18Allocation
- 34:14Generics & Optimization
- 35:07Let's Recap...
related talks
01h 00mThe Mysterious Swift Performance
18mScientific Swift
33mScaling Swift Development
36mSWIFT ABI Essentials: How to Maximize Your App's Efficiency
47mAn Introduction to the Swift Programming Language
57mCatching up with Swift
51mSwift 2 Under the Hood
30mFrom Slow to Flow: Tips for Accelerating Your App Performance
