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
190
0
Share
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.7k
Build your career one contribution at a time
robertbasic
1
70
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
210
Mockery
robertbasic
1
770
Zend Framework 2
robertbasic
4
340
Introduction to Zend Framework 1
robertbasic
2
270
Other Decks in Programming
See All in Programming
モダンOBSプラグイン開発
umireon
0
190
今からFlash開発できるわけないじゃん、ムリムリ! (※ムリじゃなかった!?)
arkw
0
170
Java 21/25 Virtual Threads 소개
debop
0
310
見せてもらおうか、 OpenSearchの性能とやらを!
shunta27
1
160
ネイティブアプリとWebフロントエンドのAPI通信ラッパーにおける共通化の勘所
suguruooki
0
230
Laravel Nightwatchの裏側 - Laravel公式Observabilityツールを支える設計と実装
avosalmon
1
270
ロボットのための工場に灯りは要らない
watany
12
3.2k
AI 開発合宿を通して得た学び
niftycorp
PRO
0
180
AI-DLC 入門 〜AIコーディングの本質は「コード」ではなく「構造」〜 / Introduction to AI-DLC: The Essence of AI Coding Is Not “Code” but “Structure”
seike460
PRO
0
120
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
170
Geminiをパートナーに神社DXシステムを個人開発した話(いなめぐDX 開発振り返り)
fujiba
0
120
Fundamentals of Software Engineering In the Age of AI
therealdanvega
2
300
Featured
See All Featured
30 Presentation Tips
portentint
PRO
1
260
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
330
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
94
The Art of Programming - Codeland 2020
erikaheidi
57
14k
sira's awesome portfolio website redesign presentation
elsirapls
0
200
Become a Pro
speakerdeck
PRO
31
5.9k
Navigating Team Friction
lara
192
16k
A designer walks into a library…
pauljervisheath
210
24k
4 Signs Your Business is Dying
shpigford
187
22k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
120
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.5k
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?