Current area: HOME -> C / C++ -> Optimization Articles
Optimization
AMD Code Optimization Guide
This document contains information to assist programmers in creating optimized code for the AMD Athlon processor. In addition to compiler and assembler designers, this document has been targeted to C and assembly-language programmers writing execution-sensitive code sequences.
C++ Code Optimizations
A no-frills list of C++ code optimizations that can be applied at any stage of a project. These optimizations can give big returns, especially when used inside tight loops.
Calculate SIN and COS faster with inline assembly
Inline assembly to speed up C++ code. Replacing double
sin(double), and double cos(double). This example will try take
use of the x86's fsincos command, which calcuales the sin and
the cos of a value. It's faster than calculating sin, and then
cos in two operations.
Inline assembly for x86 in Linux
Bharata B. Rao offers a guide to the overall use and structure of inline assembly for x86 on the Linux platform. He covers the basics of inline assembly and its various usages, gives some basic inline assembly coding guidelines, and explains the instances of inline assembly code in the Linux kernel.
MMX and assembly optimization for Intel and AMD CPU's
Here is an example of how to use AMD and Intel's MMX
technologies to increase performance. Of course, these
optimizations cannot always be applied but I hope they can
still be useful. In this example, I am adding two tables of
1000 unsigned bytes together. On my AMD Athlon XP 2500+, my
assembly code runs 2.9 times faster than the equivalent C++
compiled code.
Optimizing C++ - the WWW version
Optimizing C++ provides working programmers and those who intend to be working programmers with a practical, real-world approach to program optimization. Many of the optimization techniques presented are derived from my reading of academic journals that are, sadly, little known in the programming community.
Performance programming applied to C++
Focus on faster and more efficient code. Covers three areas; Code execution time, code / program size and programming effort.
Speed your code with the GNU Profiler
Improving the performance of your applications is rarely a wasted effort, but it's not always clear which functions the program is spending most of its execution time on. Learn how to pinpoint performance bottlenecks using gprof for both user-space and system calls on Linux.