Is “IF” expensive?
At the very lowest level (in the hardware), yes, ifs are expensive. In order to understand why, you have to understand how pipelines work. The current instruction to be executed is stored in something typically called the instruction pointer (IP) or program counter (PC); these terms are synonymous, but different terms are used with different … Read more