Faster PHP: Profile Your Scripts With Xdebug

Technology
Faster PHP: Profile Your Scripts With Xdebug

kcachegrind_20070423.jpg
Xdebug is a powerful PHP extension that can help you track down bottlenecks in your PHP code. From the Xdebug profiling howto:

The profiler in Xdebug 2 outputs profiling information in the form of a cachegrind compatible file. This allows you to use the excellent KCacheGrind tool (Linux, KDE) to analyse your profiling data. Users of the Windows operating system can use WinCacheGrind.

Shown above is a screenshot of KCacheGrind, which is showing that the particular script is devoting a lot of its time to mysql_query calls. Once you know where your code is chewing up cycles, you’ll have a better idea of where to focus any optimization efforts, either by cleaning up ineffecient code and database queries, or by employing a suitable caching strategy.

Faster PHP Apps–Profile Your Code with Xdebug – Link.

Resources:

What will the next generation of Make: look like? We’re inviting you to shape the future by investing in Make:. By becoming an investor, you help decide what’s next. The future of Make: is in your hands. Learn More.

Tagged
Discuss this article with the rest of the community on our Discord server!

ADVERTISEMENT

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 16th iteration!

Prices Increase in....

Days
Hours
Minutes
Seconds
FEEDBACK