xdebug

  • Profiling one request in production, briefly

    The slow request cannot be reproduced locally, and profiling everything in production is not an option. The trigger value has to be a secret, or anybody can make…

  • Profiling before you optimise

    Two days spent optimising a function that was 3% of the request. The profiler said so in ninety seconds, and nobody had run it.

  • Xdebug 2.7 and the profiler behind a trigger

    Loading the extension slows execution substantially even with no session and no profiler running, because it installs hooks into the engine. The trigger form means the profiler runs…

  • The N+1 that does not appear in the query log

    340 queries on a page showing twenty rows, and none of them are slow. Every one is under the threshold, which is why the slow log has nothing…

  • Xdebug on in production is a 3x tax you did not agree to

    Merely loading the extension slows execution substantially even with no debugging session and no profiler running, because it installs hooks into the engine. It ends up in production…

  • Xdebug and a sampling profiler measure different things

    Xdebug instruments every function call, so it sees everything and multiplies the runtime by three to five. A sampling profiler interrupts periodically and records the stack, so it…

  • Finding the 200 milliseconds nobody could account for

    The page took 340ms and the parts added up to 140. Measuring from the first byte nginx sees rather than from the framework boot, and what was hiding…

  • The Xdebug profiler tells you where, not why

    A profile answers “which functions consumed the time” precisely and says nothing about the reason. The most common finding is that the top entry is PDOStatement::execute, which is…

  • Upgrading a PHP 5.3 application to 5.5

    5.3 stops getting security fixes in August. Deprecations first, then the behaviour changes, then the version bump — and an APC replacement that ignores every setting you tuned.

  • Xdebug loaded in production costs you even when it is idle

    Xdebug is not something switched on for a request. Loading the extension replaces the engine’s function-call handlers for the lifetime of the process, so the overhead is paid…