Revision: Fri, 31 May 2024 16:10:39 GMT
v1.0 – outdated
This version of the documentation is outdated. Consider upgrading your project to Spiral Framework 3.12
Edit this page

Application Profiling

Spiral does not provide deep profiling functionality for your application, use tools like xDebug or BlackFire for such purposes.

Instead, framework shipped with simple benchmark class used to capture information about time consuming tasks.

All SQL queries, Storage operations and view rendering/compilation utilizes benchmarking.

User Benchmarking

You can connect benchmark functionality to your controller or service by either requesting BenchmarkerInterface or via BenchmarkTrait:

use BenchmarkTrait;

public function indexAction()
    $b = $this->benchmark('long-operation');


Visualization of collected benchmarks if specific to implementation you used, under default application such timeline can be rendered using profiler module:


Note that running your application enabled profiling will slow down execution.