我正在读一本书,作者说这if( a < 901 )比书更快if( a <= 900 ).
if( a < 901 )
if( a <= 900 )
与此简单示例不完全相同,但循环复杂代码略有性能变化.我想这必须对生成的机器代码做一些事情,以防它甚至是真的.
c++ performance assembly relational-operators
assembly ×1
c++ ×1
performance ×1
relational-operators ×1