Performance of logic statements
Posted 14 December 2008 - 10:03 PM
and "if 'expresion' if 'expresion' " you know, nested V.S logical AND.
Posted 14 December 2008 - 11:06 PM
However, you should know that in general it's not worth worrying about micro-optimizations like this, except for code in inner loops and the like that gets executed thousands of times in a program. If you're trying to optimize a program you get much more mileage out of architectural and algorithmic optimizations (i.e. designing the program well and using faster algorithms and data structures).
Posted 15 December 2008 - 03:42 AM
Posted 15 December 2008 - 05:58 AM
For more information, see the original 'Goto considered harmful' article.
Posted 15 December 2008 - 07:56 AM
Posted 15 December 2008 - 03:32 PM
Posted 15 December 2008 - 08:09 PM
But, it can find controlled use, usually in exception handling. In fact, the try/catch construct and the switch construct are basically gotos.
Read Dijkstra's letter for more...
In fact, I've read that some people believe that the issues surrounding the use of "goto" is one of the impetus for OOP.
Posted 25 December 2008 - 02:30 AM
For example, if you're writing a raytracer... Implementing a space partitioning system (eg: kd-trees) can augment your performance by huge factors when it comes to large models (we're talking hundreds of times faster for very large models). Your raytracer will pretty much NEED this kind of algorithmic optimization to be useful, so you should work into your design early on. You might also be able to gain performance by re-implementing some intersection tests in assembly to use SIMD instructions (eg: SSE*), however, the performance gain there will likely be much smaller (maybe you'll make your raytracer twice as fast, which is certainly appreciated). However, you probably don't want to introduce ASM code in there until you're certain those intersection tests aren't going to change. Those low-level optimizations should probably be a "final touch"... The icing on the cake.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users