~/talk

Speeding up protocol conformances in Swift

Talkat SwiftLeeds 2024 · 2024-10-08..10-09· [swift]
slides:none on file

Profiling real App Store binaries shows protocol conformance checks are a top cost — a flame chart attributes 470 ms to Swift_conforms_to_protocol — because cache misses force a linear scan of every protocol conformance descriptor in the Swift5 proto section. A test with 50,000 conformances -> 71 ms on first run (then fast on hits) demonstrates N² behavior; Swift 5.4’s hash-table cache gives 13x faster hits, iOS 16’s dyld prebuilds a cache but not on first launch, and a drop‑in runtime shim zcconform replacement speeds CI and snapshot testing.

AI-written summary · about

  1. 0:00Introduction to swift performance
  2. 3:15Profiling with flame charts
  3. 4:26Identifying slow conformance checks
  4. 5:46What are conformance checks
  5. 7:20Testing the conformance cache
  6. 9:18The impact of app complexity
  7. 11:18Compiler view of conformances
  8. 13:10Applications of conformance knowledge
  9. 15:23Why conformance checks are slow
  10. 18:30Mitigation strategies
  11. 20:36iOS 16 dyld optimizations
  12. 22:53Limitations of dyld cache
  13. 24:08Zconform solution
  14. 25:35Optimizing code for performance
  15. 27:30Future of swift performance
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.