{"title":"比较c++和C程序的分支特性和分支预测器性能","authors":"D. Tang, A.M.G. Maynard, L. John","doi":"10.1109/PCCC.1999.749449","DOIUrl":null,"url":null,"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++.","PeriodicalId":442628,"journal":{"name":"IEEE International Performance, Computing, and Communications Conference","volume":"19 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1900-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"6","resultStr":"{\"title\":\"Contrasting branch characteristics and branch predictor performance of C++ and C programs\",\"authors\":\"D. Tang, A.M.G. Maynard, L. John\",\"doi\":\"10.1109/PCCC.1999.749449\",\"DOIUrl\":null,\"url\":null,\"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++.\",\"PeriodicalId\":442628,\"journal\":{\"name\":\"IEEE International Performance, Computing, and Communications Conference\",\"volume\":\"19 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"1900-01-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"6\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"IEEE International Performance, Computing, and Communications Conference\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/PCCC.1999.749449\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"IEEE International Performance, Computing, and Communications Conference","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/PCCC.1999.749449","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
Contrasting branch characteristics and branch predictor performance of C++ and C programs
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++.