Profiling PHP with Xdebug
Enable Xdebug profiling and analyze callgrind output to find slow functions.
What is Xdebug?
Xdebug is a PHP extension that provides debugging, code coverage, and profiling capabilities. The profiler records how long every function call takes and how many times it is called.
Installing Xdebug
Install via PECL or package manager.
# Via PECL:
$ pecl install xdebug
# Via apt:
$ apt install php-xdebug
# Verify:
$ php -v | grep XdebugAll lessons in this course
- Profiling PHP with Xdebug
- OPcache: Bytecode Caching
- Optimizing Database Queries
- Memory Management and Performance Tips