blog.jacobstechtavern.com/p/compiler-cocaine-the-swift-method/comment/52996400

Preview meta tags from the blog.jacobstechtavern.com website.

Linked Hostnames

2

Thumbnail

Search Engine Appearance

Google

https://blog.jacobstechtavern.com/p/compiler-cocaine-the-swift-method/comment/52996400

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

https://blog.jacobstechtavern.com/p/compiler-cocaine-the-swift-method/comment/52996400

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

https://blog.jacobstechtavern.com/p/compiler-cocaine-the-swift-method/comment/52996400

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
    • title
      Comments - The Swift Method Dispatch Deep Dive
    • title
    • title
    • title
    • title
  • Open Graph Meta Tags

    7
    • og:url
      https://blog.jacobstechtavern.com/p/compiler-cocaine-the-swift-method/comment/52996400
    • og:image
      https://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:type
      article
    • og:title
      Chien Pham on Jacob’s Tech Tavern
    • og:description
      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)
  • Twitter Meta Tags

    8
    • twitter:image
      https://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:card
      summary_large_image
    • twitter:label1
      Likes
    • twitter:data1
      1
    • twitter:label2
      Replies
  • Link Tags

    31
    • alternate
      /feed
    • apple-touch-icon
      https://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-icon
      https://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-icon
      https://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-icon
      https://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