Nit-Picky.
If you can''t read that, you should NEVER EVER have a look at Perl RegExps :-)
Volker - thanks for the disassembly, it proves me right in saying some people have too much time on their hands! In fact, no difference at all, great stuff.
Could still be the debug build of course.
Some remarks to Taulin - have you ever had Compiler theory?
Off the top of my head - it would only create a new i type on the stack if the further execution of the loop required the two variables to be processed separately - which I think cannot be the case with this statement. It simply is a reordering of statements. i++ will decompose into something that uses it''s register, and then increments it, while ++i will first increment the register and then use it.
I don''t think either would take more time than the other in this case.
Most low-level optimisations are taken care of by the compiler (why do you think they are so expensive ;-) ).
Stuff you need to be careful of these days is much more complex, cache flushing, MMX instructions, SIMD... I won''t even try to learn that stuff yet, I''d rather have working code first :-)
#pragma DWIM // Do What I Mean!
~ Mad Keith ~
**I use Software Mode**
Volker - thanks for the disassembly, it proves me right in saying some people have too much time on their hands! In fact, no difference at all, great stuff.
Could still be the debug build of course.
Some remarks to Taulin - have you ever had Compiler theory?
quote:
In the ''For'' loop example, ++i should always be the choice. A for loop with 100 iterations, and using i++ is creating an i type 100 times. At each iteration, creating another instance. Which do you think is more efficient?
Off the top of my head - it would only create a new i type on the stack if the further execution of the loop required the two variables to be processed separately - which I think cannot be the case with this statement. It simply is a reordering of statements. i++ will decompose into something that uses it''s register, and then increments it, while ++i will first increment the register and then use it.
I don''t think either would take more time than the other in this case.
Most low-level optimisations are taken care of by the compiler (why do you think they are so expensive ;-) ).
Stuff you need to be careful of these days is much more complex, cache flushing, MMX instructions, SIMD... I won''t even try to learn that stuff yet, I''d rather have working code first :-)
#pragma DWIM // Do What I Mean!
~ Mad Keith ~
**I use Software Mode**
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement