| ▲ | flohofwoe a day ago | |||||||
> ...counting backwards in a for loop is faster... Maybe in 1990 ;) (it's one of many cargo cult wisdom snippets that have become mostly obsolete once C compilers got proper optimizer passes and CPUs got all sorts of pipeling tricks) | ||||||||
| ▲ | bugake 9 hours ago | parent [-] | |||||||
A cargo cult wisdom snippet is the belief that compilers automagically apply every possible optimization. But they don't, because compilers don't know everything you know. Compilers have to assume that your code can be subject to side effects you never thought of, that would change the result of the code, so a lot of possible optimizations are avoided. | ||||||||
| ||||||||