c++ Programming Glossary: optimise
C++ refactoring: conditional expansion and block elimination http://stackoverflow.com/questions/10102610/c-refactoring-conditional-expansion-and-block-elimination the code and it's also likely that the compiler may then optimise a lot of it out knowing that a block can never be called or..
Why Switch/Case and not If/Else If? http://stackoverflow.com/questions/1028437/why-switch-case-and-not-if-else-if typically faster. Although some compilers can similarly optimise if else . Test order doesn't matter. To speed up series of if..
How do I prevent my 'unused' global variables being compiled out? http://stackoverflow.com/questions/1229430/how-do-i-prevent-my-unused-global-variables-being-compiled-out constructors. Is there any way to tell the compiler not to optimise out a global variable class SomeClass public SomeClass do something..
C++ valarray vs. vector http://stackoverflow.com/questions/1602451/c-valarray-vs-vector so the compiler can make assumptions about the code and optimise it better. The main reason that Fortran is so fast is that there..
Would you use num%2 or num&1 to check if a number is even? http://stackoverflow.com/questions/1949271/would-you-use-num2-or-num1-to-check-if-a-number-is-even If you're going to say that some compilers won't optimise 2 then you should also note that some compilers use a ones'.. are completely at the mercy of the compiler's ability to optimise. Standard containers and algorithms have n levels of indirection..
Stripping linux shared libraries http://stackoverflow.com/questions/2088409/stripping-linux-shared-libraries sure the vector is actually used so the compiler doesn't optimise the unused symbols out. I believe my colleague has managed to..
Do you use curly braces for additional scoping? [closed] http://stackoverflow.com/questions/249009/do-you-use-curly-braces-for-additional-scoping on deallocating and allocating I think some compilers can optimise on this Or is it better to use different variable names altogether..
pure/const function attributes in different compilers http://stackoverflow.com/questions/2798188/pure-const-function-attributes-in-different-compilers return 1.0f 1.0f exp x In that example the compiler could optimise the function calculate to float calculate float x unsigned int..
How can I write a power function myself? http://stackoverflow.com/questions/2882706/how-can-i-write-a-power-function-myself part . Calculate the integer power with a loop you can optimise it decomposing in factors and reusing partial calculations ...
Is `volatile` required for shared memory accessed via access function? http://stackoverflow.com/questions/3148319/is-volatile-required-for-shared-memory-accessed-via-access-function must be volatile to ensure that the read in ThreadA is not optimised out however if the flag were read via a function thus... volatile.. I may test a number of compilers and find that they never optimise out a read through an accessor but then one day find a compiler..
shared_ptr by reference or by value? http://stackoverflow.com/questions/3310737/shared-ptr-by-reference-or-by-value needs to be considered separately. Unless you can move optimise it as explained by Scott Meyers in the talk video linked above..
float bits and strict aliasing http://stackoverflow.com/questions/4328342/float-bits-and-strict-aliasing Because you are memcpying a fixed amount the compiler will optimise it out. That said the union method is VERY widely supported...
C++ aliasing rules http://stackoverflow.com/questions/6320789/c-aliasing-rules y interwoven operations on x y... I'm not trying to micro optimise but I'm wondering if it's currently better to pass restricted..
Embed assembler to manipulate 64-bit registers in portable C++ http://stackoverflow.com/questions/7859568/embed-assembler-to-manipulate-64-bit-registers-in-portable-c uses 64 bit big endian register values and I'd like to optimise this using assembler to gain direct access to the carry flag..
how to achieve 4 FLOPs per cycle http://stackoverflow.com/questions/8389648/how-to-achieve-4-flops-per-cycle need to initialise differently otherwise compiler might optimise away double sum1 0.1 sum2 0.1 sum3 0.2 sum4 0.2 sum5 0.0 double..
|