This post dives deep into the different method dispatch mechanisms in Swift, including static dispatch, dynamic dispatch, virtual tables, and witness tables. It explains how these mechanisms work and their impact on code performance. The post also provides tips for optimizing code and building an intuition for dispatch behavior.

20m read timeFrom jacobbartlett.substack.com
Post cover image
Table of contents
Method DispatchStatic Dispatch (and friends)Static DispatchDynamic DispatchMaking Your Code Go FasterBuilding up an intuitionConclusion

Sort: