当前位置:网站首页>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边栏推荐
- Comparison between webgl and webgpu [3] - vertex buffer
- February 13, 2022-4-symmetric binary tree
- TypeError: this. getOptions is not a function
- UART Application Design and Simulation Verification 2 - TX Module Design (Stateless machine)
- Non rigid / flexible point cloud ICP registration
- Go语言实现原理——锁实现原理
- 带外和带内的区别
- LeetCode102. Sequence traversal of binary tree (output by layer and unified output)
- 视频标准二三事
- Dynamic planning: robbing families and houses
猜你喜欢
Technical specifications and model selection guidelines for TVs tubes and ESD tubes - recommended by jialichuang
Data type, variable declaration, global variable and i/o mapping of PLC programming basis (CoDeSys)
TVS管 与 稳压二极管参数对比
YML configuration, binding and injection, verification, unit of bean
Expectation, variance and covariance
How to design API return code (error code)?
【原创】程序员团队管理的核心是什么?
Mathematical formula screenshot recognition artifact mathpix unlimited use tutorial
98. 验证二叉搜索树 ●●
Getting started stm32--gpio (running lantern) (nanny level)
随机推荐
February 13, 2022-4-symmetric binary tree
UART Application Design and Simulation Verification 2 - TX Module Design (Stateless machine)
698. 划分为k个相等的子集 ●●
LeetCode102. Sequence traversal of binary tree (output by layer and unified output)
TVS管 与 稳压二极管参数对比
数学公式截图识别神器Mathpix无限使用教程
Matlab smooth curve connection scatter diagram
Golang code checking tool
(4)UART应用设计及仿真验证2 —— RX模块设计(无状态机)
Initial experience | purchase and activate typora software
两数之和、三数之和(排序+双指针)
【经典控制理论】自控实验总结
Multi sensor fusion of imu/ optical mouse / wheel encoder (nonlinear Kalman filter)
Selenium+pytest automated test framework practice
Fix the memory structure of JVM in one article
Non rigid / flexible point cloud ICP registration
Negative sampling
3D point cloud slam
Live tiktok shop 2022 latest gameplay card slot overseas live e-commerce new traffic
When to use useImperativeHandle, useLayoutEffect, and useDebugValue