Changes between Version 4 and Version 5 of CodeAndMemoryPerformance


Ignore:
Timestamp:
May 12, 2013, 9:43:25 AM (11 years ago)
Author:
tuan kuranes
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CodeAndMemoryPerformance

    v4 v5  
    1818 * Do whatever possible to avoid any allocation/free during the frame loop.
    1919
    20 First simplest step,  we can agree on 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:
     20First 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:
    2121
    2222 * Pass Class Parameters by Reference
     
    2626 * Use Operator= Instead of Operator Alone
    2727 * Use Explicit Constructors
    28 
    29 I'll add:
    30 
    3128 * 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.)
    3229