c++ 中继承 (is-a) 与聚合 (has-a) 的性能影响
一个简单的问题 - 使用聚合堆栈时,性能如何影响额外的调用,而不是继承和虚拟方法的性能影响?
A simple question - how does the performance impact the extra calls when using aggregation stack against the performance impact from inheritance and virtual methods?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
与任何其他静态解析的函数调用相比,虚拟主义有一点运行时开销,但这种开销是否足够大只能通过分析来确定。
这个 我最近的回答更详细地解释了这一点。
Virtualism has a little runtime overhead compared to any other statically resolved function calls but if this overhead is big enough can only be determined through profiling.
This recent answer of mine explains this in more detail.