Lecture 15: Optimization

GCC Optimizations

Knowing that GCC optimizes these various things, we can now go and intentionally design our code so that the optimizations have a large impact.

Limitations

Why not always optimize? Can be hard to debug the assembly.

Caching

Despite the above things we can do to optimize our code, the main bottleneck for performance is actually accessing memory. Caching helps improve this.