algorithmic problems (programming) can be solved in a number of ways, to achieve the same result. some run faster, some run slower. this is direct consequence of how the silicone is built and organized. say, you perform an operation using one complicated instruction, that takes many CPU cycles to complete. BUT – you can achieve the same result by breaking it down into more steps, that in total will run *faster* that the single, complicated instruction. this is more/less what code optimization is.
p.s. this is also the reason why CPU realm is divided into two contradictory approaches. ever heard of [RISC](https://en.wikipedia.org/wiki/Reduced_instruction_set_computer) vs. [CISC](https://en.wikipedia.org/wiki/Complex_instruction_set_computer)? this is exactly the same problem, but in context of silicon design and code execution approach. either one complex instruction to do something, or set of simple instructions to do exactly the same thing, but differently.
Latest Answers