theory - Is performance of "less/greater than than" better than "less/greater than or equal to" -


is computationally more performant compare less/greater than on less/greater or equal to?

intuitively 1 think less/greater than marginally better.

can compiler use trick make comparisons seem same?

a compiler eliminate e.g. less or equal to less than incrementing bound 1 if bound "alive" cannot done.

on virtually every modern cpu, there compare/jumpless , compare/jumplessequal instructions take same amount of time, because runs through same hardware modulo including or not "equals" bit.

it case computing "not less than" (and therefoe "less than") sort of free; unsigned values, equivalent carry twos's complement subtraction, cpus do. computing equal harder: cpu has determine bits of result of subtraction zero; 64 bits cpus, that's naively 64 bit and-gate pretty big , slow. cpu designers know this, , build fast networks detect quickly, precisely isn't bottleneck.

so answer "no", or clear, take same amount of time, , there no compiler tricks change that.


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -