首页> 外文会议>IEEE International Conference on Software Engineering >Refactor Conditionals into Polymorphism: What's the Performance Cost of Introducing Virtual Calls?
【24h】

Refactor Conditionals into Polymorphism: What's the Performance Cost of Introducing Virtual Calls?

机译:重构是多态性的条件:引入虚拟呼叫的性能成本是多少?

获取原文

摘要

The notion of refactoring -transforming the source-code of an object-oriented program without changing its external behavior- has been embraced by many object-oriented software developers as a way to accommodate changing requirements. If applied well, refactoring improves the maintainability of the software. However, it is believed that it does so at the sake of performance. Especially in a C++ context, the introduction of virtual function calls is often blamed for performance reduction because it introduces an extra indirection via the so-called virtual function table. To investigate the performance trade-off involved when introducing virtual functions, we compared the execution time of four benchmark programs which contain large conditionals against refactored versions where the conditionals were replaced by virtual function calls. Depending on the compiler and compiler optimizations being used, we discovered that C++ programs refactored this way often perform faster than their non-refactored counterparts, hence advise programmers not to obfuscate their programs with conditional logic in order to obtain good performance.
机译:重构的概念 - 转换面向对象程序的源代码而不改变其外部行为 - 已经被许多面向对象的软件开发人员接受了适应不断变化的要求的方式。如果应用良好,重构可以提高软件的可维护性。然而,据信它以表现为例。特别是在C ++上下文中,介绍虚拟函数调用的引入通常会归咎于性能降低,因为它通过所谓的虚拟功能表引入额外的间接。要调查介绍虚拟功能时所涉及的性能权衡,我们将四个基准程序的执行时间进行了比较,该节目包含对重构版本的大条件,其中条件被虚拟函数调用替换。根据所使用的编译器和编译器优化,我们发现C ++程序以这种方式重构,这种方式通常比其非重构对应力更快地执行,因此建议程序员不使用条件逻辑混淆其程序,以便获得良好的性能。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号