Skip to main content

Mojo module

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.

Was this page helpful?