perf

Macro perf 

Source
macro_rules! perf {
    ($($label:tt)*) => { ... };
}
Expand description

Log elapsed instruction counts since the last perf! invocation in this thread.

  • Uses a thread-local PERF_LAST snapshot.
  • Computes delta = now - last.
  • Prints a human-readable line for debugging.

Intended usage:

  • Long-running maintenance tasks where you want checkpoints in a single call.
  • Pair with perf_scope! to also capture the full call total at scope exit.

Notes:

  • On non-wasm targets, perf_counter() returns 0, so this becomes a no-op-ish counter (still records 0 deltas); this keeps unit tests compiling cleanly.