Skip to main content

8 docs tagged with "optimization"

View all tags

Compilation Phase

The compilation phase translates preprocessed C++ code into assembly language. This is where syntax checking, semantic analysis, optimization, and code generation happen.

constexpr Functions

constexpr indicates values or functions can be evaluated at compile-time, enabling compile-time computation and optimization.

Inline Assembly

Embed assembly instructions directly in C++ code for performance-critical operations, hardware access, or platform-specific features unavailable in C++.

Inline Functions

inline suggests the compiler replace function calls with function body, eliminating call overhead. Modern compilers decide automatically.

noexcept Specifier

noexcept specifies that a function won't throw exceptions, enabling optimizations and stronger guarantees.

Strict Aliasing Rule

Pointers of different types cannot point to the same memory (with exceptions). Enables compiler optimizations but causes undefined behavior when violated.

volatile Keyword

volatile tells compiler that a variable can change unexpectedly (hardware, interrupts, other threads). Prevents certain optimizations. Not for thread synchronization - use atomics instead.