About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
Publication
IEEE International Performance, Computing and Communications Conference, Proceedings 1999
Conference paper
Contrasting branch characteristics and branch predictor performance of C++ and C programs
Abstract
In today's superscalar and superpipelined computers, branch instructions are the main culprits that limit the processor from issuing instructions at a peak rate. Although C++, which is an object-oriented programming language, provides great flexibility to help solve complex programming problems, the cost is a penalty in performance when compared to C. This paper compares the intrinsic branch behavior and basic branch characteristics of C++ and C benchmarks and correlates these characteristics to the performance of branch predictors. This study produced interesting insights into the differences between C++ and C benchmarks with respect to branch behavior. The basic branch characteristics showed that C++ programs have more inconsistency for the targets of branch instructions than C benchmarks. Various branch prediction schemes were tested, and the results show that although it is possible to predict whether a branch is taken or not taken with similar prediction accuracies in C++ and C, when branch target buffers (BTB) are considered, target inconsistency makes target prediction more difficult in C++. Improving the BTB to better accommodate the inconsistent Mature of C++ targets can reduce the penalty due to specific programming styles and practices of C++.