Background for the header
To the home page of the University of Antwerp

 

 

LORE / Publications

 

TitleRefactor Conditionals into Polymorphism: What is the Performance Cost of Introducing Virtual Calls ?
Author(s)Serge Demeyer
Download N/A
Links
AbstractThe 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.
BibTeX
@inproceedings{Demeyer05ICSM,
	author = {Serge Demeyer},
	title = {Refactor Conditionals into Polymorphism: What is the Performance Cost of Introducing Virtual Calls ?},
	booktitle = {Proceedings ICSM'05 (International Conference on Software Maintenance)},
	pages = {627-630},
	publisher = {IEEE Press},
	year = {2005},
	note = {[Acceptance ratio: (55 + 25) / 180}
}
Valid HTML 4.01! Valid CSS!

 Lab On REengineering - Antwerpen, last modified 12:35:26 17 August 2010