blog.jacobstechtavern.com/p/compiler-cocaine-the-swift-method/comment/52996400
Preview meta tags from the blog.jacobstechtavern.com website.
Linked Hostnames
2Thumbnail

Search Engine Appearance
Chien Pham on Jacob’s Tech Tavern
Thanks for great writing, below is my understanding, pls let me know if I'm wrong 🙏 1. inline / precomputing (dispatch) - execute directly, no jump - well know info at compile time - e.g: simple struct, enum definition 2. static dispatch: - 1 jump to execute address - execute memory address is knowable at compile time 3. dynamic dispatch (virtual table / witness table dispatch) - inheritance / polymorphism (method override, protocol conforms …) - method execute address is stored in function table - 2 jumps when execute: (1) jumps to the function table, (2) access `vTable[method_name]` to get the execute access 4. message dispatch - powered by Objective-C runtime , pure swift don’t have message dispatch - using `objc_msgSend` to determine the implementation of a given `selector` , - complier search through class (NSObject subclass) hierarchy bottom up, - each class can provide the implementation at runtime using several method level: `resolveInstanceMethod`, `forwardingTargetForSelector` , `forwardInvocation` (similar for class method)
Bing
Chien Pham on Jacob’s Tech Tavern
Thanks for great writing, below is my understanding, pls let me know if I'm wrong 🙏 1. inline / precomputing (dispatch) - execute directly, no jump - well know info at compile time - e.g: simple struct, enum definition 2. static dispatch: - 1 jump to execute address - execute memory address is knowable at compile time 3. dynamic dispatch (virtual table / witness table dispatch) - inheritance / polymorphism (method override, protocol conforms …) - method execute address is stored in function table - 2 jumps when execute: (1) jumps to the function table, (2) access `vTable[method_name]` to get the execute access 4. message dispatch - powered by Objective-C runtime , pure swift don’t have message dispatch - using `objc_msgSend` to determine the implementation of a given `selector` , - complier search through class (NSObject subclass) hierarchy bottom up, - each class can provide the implementation at runtime using several method level: `resolveInstanceMethod`, `forwardingTargetForSelector` , `forwardInvocation` (similar for class method)
DuckDuckGo
Chien Pham on Jacob’s Tech Tavern
Thanks for great writing, below is my understanding, pls let me know if I'm wrong 🙏 1. inline / precomputing (dispatch) - execute directly, no jump - well know info at compile time - e.g: simple struct, enum definition 2. static dispatch: - 1 jump to execute address - execute memory address is knowable at compile time 3. dynamic dispatch (virtual table / witness table dispatch) - inheritance / polymorphism (method override, protocol conforms …) - method execute address is stored in function table - 2 jumps when execute: (1) jumps to the function table, (2) access `vTable[method_name]` to get the execute access 4. message dispatch - powered by Objective-C runtime , pure swift don’t have message dispatch - using `objc_msgSend` to determine the implementation of a given `selector` , - complier search through class (NSObject subclass) hierarchy bottom up, - each class can provide the implementation at runtime using several method level: `resolveInstanceMethod`, `forwardingTargetForSelector` , `forwardInvocation` (similar for class method)
General Meta Tags
16- titleComments - The Swift Method Dispatch Deep Dive
- title
- title
- title
- title
Open Graph Meta Tags
7- og:urlhttps://blog.jacobstechtavern.com/p/compiler-cocaine-the-swift-method/comment/52996400
- og:imagehttps://substackcdn.com/image/fetch/$s_!-yrK!,f_auto,q_auto:best,fl_progressive:steep/https%3A%2F%2Fjacobbartlett.substack.com%2Ftwitter%2Fsubscribe-card.jpg%3Fv%3D1231635496%26version%3D9
- og:typearticle
- og:titleChien Pham on Jacob’s Tech Tavern
- og:descriptionThanks for great writing, below is my understanding, pls let me know if I'm wrong 🙏 1. inline / precomputing (dispatch) - execute directly, no jump - well know info at compile time - e.g: simple struct, enum definition 2. static dispatch: - 1 jump to execute address - execute memory address is knowable at compile time 3. dynamic dispatch (virtual table / witness table dispatch) - inheritance / polymorphism (method override, protocol conforms …) - method execute address is stored in function table - 2 jumps when execute: (1) jumps to the function table, (2) access `vTable[method_name]` to get the execute access 4. message dispatch - powered by Objective-C runtime , pure swift don’t have message dispatch - using `objc_msgSend` to determine the implementation of a given `selector` , - complier search through class (NSObject subclass) hierarchy bottom up, - each class can provide the implementation at runtime using several method level: `resolveInstanceMethod`, `forwardingTargetForSelector` , `forwardInvocation` (similar for class method)
Twitter Meta Tags
8- twitter:imagehttps://substackcdn.com/image/fetch/$s_!-yrK!,f_auto,q_auto:best,fl_progressive:steep/https%3A%2F%2Fjacobbartlett.substack.com%2Ftwitter%2Fsubscribe-card.jpg%3Fv%3D1231635496%26version%3D9
- twitter:cardsummary_large_image
- twitter:label1Likes
- twitter:data11
- twitter:label2Replies
Link Tags
31- alternate/feed
- apple-touch-iconhttps://substackcdn.com/image/fetch/$s_!WtGp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc34b85d-23ce-401f-a687-4eea4207cf88%2Fapple-touch-icon-57x57.png
- apple-touch-iconhttps://substackcdn.com/image/fetch/$s_!n07t!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc34b85d-23ce-401f-a687-4eea4207cf88%2Fapple-touch-icon-60x60.png
- apple-touch-iconhttps://substackcdn.com/image/fetch/$s_!KDPz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc34b85d-23ce-401f-a687-4eea4207cf88%2Fapple-touch-icon-72x72.png
- apple-touch-iconhttps://substackcdn.com/image/fetch/$s_!O9cp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc34b85d-23ce-401f-a687-4eea4207cf88%2Fapple-touch-icon-76x76.png
Links
13- https://blog.jacobstechtavern.com
- https://blog.jacobstechtavern.com/p/compiler-cocaine-the-swift-method/comment/52996400
- https://blog.jacobstechtavern.com/p/compiler-cocaine-the-swift-method/comments#comment-52996400
- https://substack.com
- https://substack.com/@chienpham/note/c-52996400