It depends. In a naive compiler, pre-increment will be faster. In pseudo-code, where each of them:
preincrement() { val = val + 1; return val; } postincrement() { tmp = val;
In practice, the compiler often turns postincrmeent into preincrement when it can handle it. But for complex types, he may not be able to do this. As a rule, use preincrement whenever you can, and use only postincrmenet when you need the specific semantics of this operation.
jalf
source share