Speed of execution in term of code in some cases
Is “else if” faster than “switch() case”?
For small loops not required,For very big loop hash table is used for switch case so faster execution.
But with good compiler with optimization enabled, it's same.
Why i++ is faster than i=i+1 in c
older compilers used
(1)ADD \\i+1
(2)Assignment operation \i=x
for i=i+1
for i++
(1)INR
but currently good compilers with optimizations enabled creates same assembly code.
Comments