I was wondering what was faster. Is it when you do a for loop with only one instruction (i.e 1=1) 9 times or is it when you go through 9 if condition?
I think the ifs are faster because you don't need to check for instruction in the loop
It should be pretty much the same - because for
loops are essentially checking if a condition is true and running a block of code - very similar to if
statements.
For details on how for
loops and if
statement are typically implemented in assembly - have a look at https://en.wikibooks.org/wiki/X86_Disassembly/Loops and complex IF statement in assembly
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With