C for loop indexing: is forward-indexing faster in new CPUs?

后端 未结 7 2087
抹茶落季
抹茶落季 2020-12-01 09:57

On a mailing list I\'m subscribed to, two fairly knowledgeable (IMO) programmers were discussing some optimized code, and saying something along the lines of:

7条回答
  •  萌比男神i
    2020-12-01 10:21

    When optimizing loops I'd rather look into loop unrolling (as it cuts down the number of comparisons vs. the exit value, and it may be optimized for parallel processing (MMX) depending on what goes on inside the loop).

提交回复
热议问题