Laravel Packages

Artisan Benchmark

Published
Artisan Benchmark image

Laravel core team member Christoph Rumpel, in a recent video, demonstrated a new package that he created called Artisan Benchmark. The package allows you to benchmark your Artisan commands to get metrics such as:

  • Execution Time
  • Memory Usage
  • SQL Query Count
  • Number of Rows returned/affected

You can install this package using Composer:

composer require christophrumpel/artisan-benchmark

Then benchmark your command using:

php artisan benchmark your:command

If you don't pass in your command as an argument, it will display a list of available commands.

Note: this package only tracks query counts for queries executed through Eloquent or the Query Builder. However, contributions are welcomed to improve the package.

To learn more about this package, you can view the source code on Github.

Yannick Lyn Fatt photo

Staff Writer at Laravel News and Full stack web developer.

Sponsored

masteringlaravel logo
Laravel Code Review

Get expert guidance in a few days with a Laravel code review

Visit Laravel Code Review

The latest

View all →
NativePHP v4: Build Native iOS and Android UI in Blade image

NativePHP v4: Build Native iOS and Android UI in Blade

Read article
Laravel Lock: Distributed Locks for Models and Routes image

Laravel Lock: Distributed Locks for Models and Routes

Read article
Laravel Image Responses: Serve Resized Images From Routes image

Laravel Image Responses: Serve Resized Images From Routes

Read article
Pause All Laravel Queues During a Deploy image

Pause All Laravel Queues During a Deploy

Read article
Laravel Terminal UI for the artisan dev Command image

Laravel Terminal UI for the artisan dev Command

Read article
Pause All Queues and a New artisan dev UI in Laravel 13.25 image

Pause All Queues and a New artisan dev UI in Laravel 13.25

Read article