Last updated on Monday, October 06, 2025
@inproceedings{Demeyer05ICSM,
author = {Serge Demeyer},
booktitle = {Proceedings {ICSM}'05 (International Conference on
Software Maintenance)},
note = {Acceptance ratio: (55 + 25) / 180 = 44\%},
pages = {627-630},
publisher = {{IEEE} Press},
title = {Refactor Conditionals into Polymorphism: What is the
Performance Cost of Introducing Virtual Calls ?},
year = {2005},
abstract = {The notion of refactoring Ñtransforming the
sourcecode of an object-oriented program without
changing its external behaviorÑ has been embraced by
many objectoriented 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.},
annote = {internationalconference},
top = {A in CORE2013},
}