Changes between Version 4 and Version 5 of CodeAndMemoryPerformance
- Timestamp:
- May 12, 2013, 9:43:25 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CodeAndMemoryPerformance
v4 v5 18 18 * Do whatever possible to avoid any allocation/free during the frame loop. 19 19 20 First simplest step, we can agree onavoiding all "hidden" temporary object allocation by following simple rules, which are explained [http://www.tantalon.com/pete/cppopt/main.htm here], and as a recap:20 First simplest step, avoiding all "hidden" temporary object allocation by following simple rules, which are explained [http://www.tantalon.com/pete/cppopt/main.htm here], and as a recap: 21 21 22 22 * Pass Class Parameters by Reference … … 26 26 * Use Operator= Instead of Operator Alone 27 27 * Use Explicit Constructors 28 29 I'll add:30 31 28 * Prefer passing parameter by value whenever possible ( don't return object allocated on the stack, don't ever return containers allocated on the stack). [[BR]]( you could be sure that all compilers does trigger any form of return value optimization ( RVO, NRVO, URVO, opy elision), by checking assembly code generated, but that doesn't change that debug builds will be slower because of not doing the optimization anyway, and impose the burden of checking it if new/old compiler/transpiler is added to compilation supports.) 32 29