Profiler
The debug toolbar
Run the app in dev mode and look at the bottom of the page. A dark bar appears with the request time, memory use, and counts for queries, mails, and logs.
Each block in the bar opens the full profiler for the current request. Click a block to jump straight to its panel.
Timeline
The timeline draws every step of the request from left to right. Controllers, listeners, database calls, and template renders each get a colored bar.
Long bars point at slow work. When one listener takes most of the time, start the fix there.
Doctrine panel
The Doctrine panel lists every query of the request in order. It shows the SQL text, the time, and how many queries ran in total.
Watch for repeated queries inside loops. One list page should run a few queries, not hundreds.
Off in prod
Production never shows the toolbar. The profiler only boots when debug mode is on, so prod stays fast and private.
A tiny check below shows the idea: read the debug flag and keep the profiler off when it is zero.
$debug = $_SERVER["APP_DEBUG"] ?? "0"; if ($debug === "1") { echo "Profiler may run in dev"; } if ($debug === "0") { echo "Profiler stays off in prod"; }
Next: Testing
Article author: Arthur Isaev