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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
robertbasic
January 28, 2017
Programming
0
190
Code profiling with Xdebug and Kcachegrind
Slides for an uncon talk I gave at phpbnl17
robertbasic
January 28, 2017
Tweet
Share
More Decks by robertbasic
See All by robertbasic
All aboard the Service Bus!
robertbasic
1
1.7k
Build your career one contribution at a time
robertbasic
1
69
All aboard the Service Bus @ ZGPHP
robertbasic
0
390
All aboard the Service Bus
robertbasic
1
310
Build your career one contribution at a time
robertbasic
0
150
Profilisanje koda sa Xdebug i KCachegrind
robertbasic
1
200
Mockery
robertbasic
1
760
Zend Framework 2
robertbasic
4
340
Introduction to Zend Framework 1
robertbasic
2
270
Other Decks in Programming
See All in Programming
Unity6.3 AudioUpdate
cova8bitdots
0
120
技術検証結果の整理と解析をAIに任せよう!
keisukeikeda
0
120
nuget-server - あなたが必要だったNuGetサーバー
kekyo
PRO
0
230
ロボットのための工場に灯りは要らない
watany
10
2.7k
AWS Infrastructure as Code の新機能 2025 総まとめ 〜SA 4人による怒涛のデモ祭り〜
konokenj
10
3.3k
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
900
Windows on Ryzen and I
seosoft
0
260
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
240
SourceGeneratorのマーカー属性問題について
htkym
0
190
AI時代のソフトウェア開発でも「人が仕様を書く」から始めよう-医療IT現場での実践とこれから
koukimiura
0
140
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
220
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
220
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Done Done
chrislema
186
16k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
190
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
760
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
630
What does AI have to do with Human Rights?
axbom
PRO
1
2k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.4k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
140
So, you think you're a good person
axbom
PRO
2
2k
WCS-LA-2024
lcolladotor
0
480
The agentic SEO stack - context over prompts
schlessera
0
690
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?