当前位置:网站首页>Objective C message dispatch mechanism
Objective C message dispatch mechanism
2022-07-05 23:26:00 【javail】
problem :
I am just staring to play around with Objective C (writing toy iPhone apps) and I am curious about the underlying mechanism used to dispatch messages. I just want to play Objective C( Writing toys iPhone Applications ), I'm curious about the underlying mechanism for sending messages .I have a good understanding of how virtual functions in C++ are generally implemented and what the costs are relative to a static or non-virtual method call, but I don't have any background with Obj-C to know how messages are sent. I know very well C++ How to implement virtual functions in , And the cost relative to static or non virtual method calls , But I don't have any Obj-C Background to understand how messages are sent .Browsing around I found this loose benchmark and it mentions IMP cached messages being faster than virtual function calls, which are in turn faster than a standard message send. When browsing, I found This Loose benchmarks , It refers to IMP Cached messages are faster than virtual function calls , Virtual function calls are faster than standard messages .
I am not trying to optimize anything, just get deeper understanding of how exactly the messages get dispatched. I'm not trying to optimize anything , Just learn more about how messages are sent .
- How are Obj-C messages dispatched?Obj-C How messages are sent ?
- How do Instance Method Pointers get cached and can you (in general) tell by reading the code if a message will get cached? How instance method pointers are cached , Can you ( Usually ) Read the code to determine whether a message will be cached ?
- Are class methods essentially the same as a C function (or static class method in C++), or is there something more to them? Class methods are essentially the same as C function ( or C++ Static class methods in ) identical , Or do they have more things ?
I know some of these questions may be 'implementation dependent' but there is only one implementation that really counts. I know some of these problems may “ Depend on the realization ”, But only one implementation is really important .
Solution :
Reference resources : https://stackoom.com/en/question/47Ua边栏推荐
猜你喜欢

Non rigid / flexible point cloud ICP registration

LabVIEW打开PNG 图像正常而 Photoshop打开得到全黑的图像

Mathematical formula screenshot recognition artifact mathpix unlimited use tutorial
![Development specification: interface unified return value format [resend]](/img/3e/8751b818147cabbe22e4ce44af7d24.jpg)
Development specification: interface unified return value format [resend]

CJ mccullem autograph: to dear Portland

基于脉冲神经网络的物体检测

开关电源Buck电路CCM及DCM工作模式

Go语言实现原理——Map实现原理

February 13, 2022-4-symmetric binary tree

Commonly used probability distributions: Bernoulli distribution, binomial distribution, polynomial distribution, Gaussian distribution, exponential distribution, Laplace distribution and Dirac delta d
随机推荐
UVA – 11637 Garbage Remembering Exam (组合+可能性)
Non rigid / flexible point cloud ICP registration
CJ mccullem autograph: to dear Portland
LeetCode102. Sequence traversal of binary tree (output by layer and unified output)
698. Divided into k equal subsets ●●
Difference between out of band and in band
golang代码检查工具
npm ELECTRON_ Mirror is set as domestic source (npmmirror China mirror)
Matlab smooth curve connection scatter diagram
派对的最大快乐值
Commonly used probability distributions: Bernoulli distribution, binomial distribution, polynomial distribution, Gaussian distribution, exponential distribution, Laplace distribution and Dirac delta d
3: Chapter 1: understanding JVM specification 2: JVM specification, introduction;
TVS管和ESD管的技术指标和选型指南-嘉立创推荐
Leetcode buys and sells stocks
东南亚电商指南,卖家如何布局东南亚市场?
LeetCode145. Post order traversal of binary tree (three methods of recursion and iteration)
Realize reverse proxy client IP transparent transmission
424. 替换后的最长重复字符 ●●
February 13, 2022-4-symmetric binary tree
Judge whether the binary tree is a complete binary tree