// docs

Benchmark mode

Run snippets repeatedly and compare two Laravel approaches side by side.

Benchmark mode helps you answer practical performance questions inside the Laravel app where the code will actually run. It is built for comparing Eloquent query shapes, collection operations, service calls, and other snippets that benefit from repeated measurement.

  • Run warmups before measuring.
  • Compare two snippets side by side.
  • Switch between hot and cold sessions.
  • Inspect outliers and trim them from the summary.
// Variant A
User::query()->where('active', true)->count();

// Variant B
User::query()->active()->count();
Benchmark mode: repeated runs, side-by-side comparison, outlier trimming, and summary stats.