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
130
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
46
All aboard the Service Bus @ ZGPHP
robertbasic
0
290
All aboard the Service Bus
robertbasic
1
270
Build your career one contribution at a time
robertbasic
0
110
Profilisanje koda sa Xdebug i KCachegrind
robertbasic
1
160
Mockery
robertbasic
1
580
Zend Framework 2
robertbasic
4
300
Introduction to Zend Framework 1
robertbasic
2
200
Other Decks in Programming
See All in Programming
技術的負債と向き合うカイゼン活動を1年続けて分かった "持続可能" なプロダクト開発
yuichiro_serita
0
120
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
320
快速入門可觀測性
blueswen
0
400
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
3
630
Kaigi on Railsに初参加したら、その日にLT登壇が決定した件について
tama50505
0
100
ドメインイベント増えすぎ問題
h0r15h0
2
390
週次リリースを実現するための グローバルアプリ開発
tera_ny
1
110
103 Early Hints
sugi_0000
1
250
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
210
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
Facilitating Awesome Meetings
lara
50
6.1k
Building Your Own Lightsaber
phodgson
103
6.1k
Docker and Python
trallard
42
3.1k
Building Adaptive Systems
keathley
38
2.3k
Building an army of robots
kneath
302
44k
Automating Front-end Workflow
addyosmani
1366
200k
How to Ace a Technical Interview
jacobian
276
23k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
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?