49

C++性能榨汁机之分支预测器(4) - I'm Root lee !

 6 years ago
source link: http://irootlee.com/juicer_branch_predictor4/?
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
前言  在上篇文章中,我们通过分析一段典型程序的汇编级代码更加清楚的看到了分支预测对程序性能的影响,当数据对分支预测器预测不友好的时候,我们的程序性能下降巨大。那么,怎么才能避免分支预测频繁出错对我们程序运行的不利影响呢?用条件传送替代条件控制转移  分支预测对有规律的分支跳转可以实现非常高的预测正确率,比如在循环判断中,在循环终止之前,分支预测都可以基本保证完全的预测正确,预测错误只会出现在最

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK