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
robertbasic
January 28, 2017
Programming
0
160
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.6k
Build your career one contribution at a time
robertbasic
1
49
All aboard the Service Bus @ ZGPHP
robertbasic
0
310
All aboard the Service Bus
robertbasic
1
280
Build your career one contribution at a time
robertbasic
0
120
Profilisanje koda sa Xdebug i KCachegrind
robertbasic
1
170
Mockery
robertbasic
1
660
Zend Framework 2
robertbasic
4
310
Introduction to Zend Framework 1
robertbasic
2
230
Other Decks in Programming
See All in Programming
Practical Tips and Tricks for Working with Compose Multiplatform Previews (mDevCamp 2025)
stewemetal
0
120
KotlinConf 2025 現地で感じたServer-Side Kotlin
n_takehata
1
170
「兵法」から見る質とスピード
ickx
0
250
インターフェース設計のコツとツボ
togishima
2
690
「ElixirでIoT!!」のこれまでとこれから
takasehideki
0
320
GoのWebAssembly活用パターン紹介
syumai
3
8k
Cloudflare Realtime と Workers でつくるサーバーレス WebRTC
nekoya3
0
370
生成AIで日々のエラー調査を進めたい
yuyaabo
0
460
Parallel::Pipesの紹介
skaji
2
900
Passkeys for Java Developers
ynojima
2
820
FormFlow - Build Stunning Multistep Forms
yceruto
1
140
Devinで実践する!AIエージェントと協働する開発組織の作り方
masahiro_nishimi
6
2.9k
Featured
See All Featured
Speed Design
sergeychernyshev
30
980
Why You Should Never Use an ORM
jnunemaker
PRO
56
9.4k
Designing for humans not robots
tammielis
253
25k
Site-Speed That Sticks
csswizardry
10
620
A Modern Web Designer's Workflow
chriscoyier
693
190k
Unsuck your backbone
ammeep
671
58k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
52
2.8k
Balancing Empowerment & Direction
lara
1
190
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.5k
What's in a price? How to price your products and services
michaelherold
245
12k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
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?