Skip to main content
Version: 1.0

compiler

Provides compiler hints to prevent optimization of benchmark code.

This module includes utilities that prevent the compiler from optimizing away code being benchmarked. The keep() and black_box() functions provide hints to the compiler from overly optimizing away code being benchmarked.

Functions

  • black_box: Prevents the compiler from optimizing away computations or values.
  • keep: Provides a hint to the compiler to not optimize the variable use away.