CSS Prepare

optional · CSS study notes

Code Optimization

  • Elimination of redundant code: removing computations whose results are never used or already computed
  • Constant folding: evaluating constant expressions at compile time rather than runtime (e.g., replacing 2 + 3 with 5)
  • Loop optimization: e.g., moving loop-invariant computations outside the loop
  • Peephole optimization: examining a small, sliding "window" of generated instructions and replacing inefficient patterns with more efficient equivalents