Although DDEV has more sophisticated profiling capabilities with xhprof and Blackfire, it also has built-in support for Xdebug profiling.
- Create the directory
.ddev/xdebug, which is where the output files will be dumped.
Switch Xdebug to profiling mode by adding this in
Enable Xdebug with
ddev xdebug on.
- Make an HTTP request to the DDEV project and the profile will be located in
- Analyze it with any call graph viewer, for example kcachegrind.
- When you’re done, execute
ddev xdebug offto avoid generating unneeded profile files.
Last update: December 28, 2022