SDAA248 October   2026 AM2752-Q1 , AM2754-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Profiling Existing Algorithms
    1. 1.1 Measuring Cycles With the CPU Cycle Counter
  5. 2Compiler Optimizations
    1. 2.1 Verifying Compiler Optimization with Generated Assembly
  6. 3Double Check Memory Cache Settings
  7. 4Use Existing Optimized Libraries
  8. 5Optimizing Custom Kernels/Modules
  9. 6Example
    1. 6.1 Example System Results Summary

Compiler Optimizations

The first step to improve performance is also the least amount of effort required, which is to let the C7x compiler optimize the code where it can. Within the code composer studio (CCS) project, open the project settings and check the optimization level used under Tools, C7000 Compiler, Optimization.

 Setting Optimization Level Figure 2-1 Setting Optimization Level

For the optimization level, the higher the number (0 to 4), the more compiler optimizations are applied, at the expense of ease of debug. It is typically recommended to have the optimization level at 3 or higher to provide the best opportunity for optimizing existing code without much hand-optimization. The speed versus size tradeoff is used to tell the compiler whether to prioritize application code memory footprint (size or 0) or fastest run time (speed or 5) or somewhere in between. During debug, these optimizations are typically off to allow the user to easily debug the program, but the performance is reduced as a result. As the compilier more heavily optimizes the code, it becomes more difficult to step through code or look at variables, as sometimes these are completely removed. For detailed information about what these options do, refer to the C7000 C/C++ Optimization guide.