Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Code profiling with Xdebug and Kcachegrind

Code profiling with Xdebug and Kcachegrind

Slides for an uncon talk I gave at phpbnl17

robertbasic

January 28, 2017
Tweet

More Decks by robertbasic

Other Decks in Programming

Transcript

  1. Robert Basic ~ phpbenelux17 Code profiling with Xdebug and KCachegrind

    Robert Basic https://robertbasic.com/ @robertbasic
  2. Robert Basic ~ phpbenelux17 Tools of the trade Xdebug •

    Not just for debugging KCachegrind • Visualizing profiling data
  3. Robert Basic ~ phpbenelux17 Tips for fixing performance issues •

    Biggest impact, least effort • Profile after every change • Avoid over-optimizing • Learn to EXPLAIN
  4. Robert Basic ~ phpbenelux17 Tips for using Xdebug and KCachegrind

    • Xdebug – xdebug.profiler_output_dir – xdebug.profiler_output_name – cachegrind.out.%t.%R – Xdebug lies! • KCachegrind – Install graphviz – Use % relative – Turn on Cycle detection – Settings > Configure KCachegrind > Annotations > Add source folder