使用可能/不可能的提示是否有任何性能测试结果? [英] Are there any perfomance test results for usage of likely/unlikely hints?

查看:255
本文介绍了使用可能/不可能的提示是否有任何性能测试结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

gcc功能可能/不可能的提示,可帮助编译器生成具有更好分支预测的机器码。

gcc features likely/unlikely hints that help the compiler to generate machine code with better branch prediction.

有关如何正确使用或未能使用这些提示会影响真实代码在某些真实系统上的性能的任何数据吗?

Is there any data on how proper usage or failure to use those hints affects performance of real code on some real systems?

推荐答案

问题不同,但 Peter Cordes的回答,关于此问题给出一个清晰的提示;)。现代CPU忽略静态提示并使用动态分支预测。

The question differs, but Peter Cordes's answer on this question gives a clear hint ;) . Modern CPU's ignore static hints and use dynamic branch prediction.

这篇关于使用可能/不可能的提示是否有任何性能测试结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆