Which is faster? Here it is quick and dirty - post-increment can never be faster than pre-increment, but can sometimes be slower. Why? There's an extra copy happening in the post-increment due to saving the value THEN incrementing. So, what would you prefer? C++ or ++C?
Wednesday, August 27, 2008
Subscribe to:
Post Comments (Atom)
2 comments:
hey douche, we learned this sophomore year college, remember? nothing new :)
The question you are asking has the answer within itself; it's a matter of preference and application. If you are not sure what kind of performance the application needs, you can always monitor the assembly instructions being processed...
Post a Comment