Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Code profiling with Xdebug and Kcachegrind
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
robertbasic
January 28, 2017
Programming
210
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Code profiling with Xdebug and Kcachegrind
Slides for an uncon talk I gave at phpbnl17
robertbasic
January 28, 2017
More Decks by robertbasic
See All by robertbasic
All aboard the Service Bus!
robertbasic
1
1.8k
Build your career one contribution at a time
robertbasic
1
77
All aboard the Service Bus @ ZGPHP
robertbasic
0
400
All aboard the Service Bus
robertbasic
1
320
Build your career one contribution at a time
robertbasic
0
160
Profilisanje koda sa Xdebug i KCachegrind
robertbasic
1
220
Mockery
robertbasic
3
830
Zend Framework 2
robertbasic
4
350
Introduction to Zend Framework 1
robertbasic
2
280
Other Decks in Programming
See All in Programming
継続モナドとリアクティブプログラミング
yukikurage
3
490
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
100
えっ!!コードを読まずに開発を!?
hananouchi
0
190
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
360k
Mujeres en SEO Summit 2026 - Greatest Disaster Hits en Web Performance
guaca
0
240
自作OSでスライド発表する
uyuki234
1
3.8k
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
190
Webフレームワークの ベンチマークについて
yusukebe
0
200
【やさしく解説 設計編・中級 #1】一つの車に、運転手は一人 ~ある倉庫システムの事例から~
panda728
PRO
0
160
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
170
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
580
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
140
Featured
See All Featured
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
Un-Boring Meetings
codingconduct
0
340
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.9k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
220
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
Scaling GitHub
holman
464
140k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
750
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
Building the Perfect Custom Keyboard
takai
2
810
Accessibility Awareness
sabderemane
1
150
Statistics for Hackers
jakevdp
799
230k
Transcript
Robert Basic ~ phpbenelux17 Code profiling with Xdebug and KCachegrind
Robert Basic https://robertbasic.com/ @robertbasic
Robert Basic ~ phpbenelux17 Tools of the trade Xdebug •
Not just for debugging KCachegrind • Visualizing profiling data
Robert Basic ~ phpbenelux17 What’s the fastest code?
Robert Basic ~ phpbenelux17 The code that’s not called!
Robert Basic ~ phpbenelux17 Number of calls
Robert Basic ~ phpbenelux17 Who’s to blame?
Robert Basic ~ phpbenelux17 Which was called by another method
Robert Basic ~ phpbenelux17 Which was called by another method
Robert Basic ~ phpbenelux17 So many callers!
Robert Basic ~ phpbenelux17 A graph to see it
Robert Basic ~ phpbenelux17 Context to understand it
Robert Basic ~ phpbenelux17 Fix it This is really up
to you
Robert Basic ~ phpbenelux17 Tips for fixing performance issues •
Biggest impact, least effort • Profile after every change • Avoid over-optimizing • Learn to EXPLAIN
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
Robert Basic ~ phpbenelux17 Other tools • WinCacheGrind, Webgrind •
XHProf • Blackfire.io
Robert Basic ~ phpbenelux17 Thanks! Questions?