Dave's Brain

Browse - Programming Tips - Which is faster pre- or post- increment?

Date: 2014sep19
Language: C/C++

Q.  Which is faster pre- or post- increment?

A.  They are the same:

This post shows they emit the exactly same assembler:
https://news.ycombinator.com/item?id=8341817

Perhaps there was a difference in the past.

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.