I have been reading through most of the answers here and many of the comments, and I didn't see any reference to the one instance that I could think of where i++
is more efficient than ++i
(and perhaps surprisingly --i
was more efficient than i--
). That is for C compilers for the DEC PDP-11!
The PDP-11 had assembly instructions for pre-decrement of a register and post-increment, but not the other way around. The instructions allowed any "general-purpose" register to be used as a stack pointer. So if you used something like *(i++)
it could be compiled into a single assembly instruction, while *(++i)
could not.
This is obviously a very esoteric example, but it does provide the exception where post-increment is more efficient(or I should say was, since there isn't much demand for PDP-11 C code these days).