当前位置:网站首页>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边栏推荐
- Introduction to JVM
- Non rigid / flexible point cloud ICP registration
- Design and implementation of secsha system
- idea 连接mysql ,直接贴配置文件的url 比较方便
- Hainan Nuanshen tea recruits warmhearted people: recruitment of the product experience recommender of Nuanshen multi bubble honey orchid single cluster
- 基于脉冲神经网络的物体检测
- Week 17 homework
- LabVIEW打开PNG 图像正常而 Photoshop打开得到全黑的图像
- 数据库基础知识(面试)
- 数学公式截图识别神器Mathpix无限使用教程
猜你喜欢
3:第一章:认识JVM规范2:JVM规范,简介;
Commonly used probability distributions: Bernoulli distribution, binomial distribution, polynomial distribution, Gaussian distribution, exponential distribution, Laplace distribution and Dirac delta d
Pyqt control part (I)
Dynamic memory management (malloc/calloc/realloc)
Douban scoring applet Part-2
14种神笔记方法,只需选择1招,让你的学习和工作效率提高100倍!
[original] what is the core of programmer team management?
How to design API return code (error code)?
并查集实践
LabVIEW打开PNG 图像正常而 Photoshop打开得到全黑的图像
随机推荐
Development specification: interface unified return value format [resend]
无刷驱动设计——浅谈MOS驱动电路
Negative sampling
698. 划分为k个相等的子集 ●●
[Yu Yue education] NC machining technology reference materials of Shaanxi University of science and technology
开关电源Buck电路CCM及DCM工作模式
Hj16 shopping list
UVA11294-Wedding(2-SAT)
Composition of interface
Marginal probability and conditional probability
What is the process of building a website
Common static methods of math class
The maximum happiness of the party
Expectation, variance and covariance
Object detection based on impulse neural network
regular expression
2:第一章:认识JVM规范1:JVM简介;
98. 验证二叉搜索树 ●●
Multi camera stereo calibration
Krypton Factor-紫书第七章暴力求解