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
140
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
48
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
160
Mockery
robertbasic
1
630
Zend Framework 2
robertbasic
4
300
Introduction to Zend Framework 1
robertbasic
2
210
Other Decks in Programming
See All in Programming
いまさら聞けない生成AI入門: 「生成AIを高速キャッチアップ」
soh9834
12
3.8k
Go1.24で testing.B.Loopが爆誕
kuro_kurorrr
0
170
Let's Take a Peek at PHP Parser 5.x!
inouehi
0
100
AI Agents with JavaScript
slobodan
0
150
エンジニア未経験が最短で戦力になるためのTips
gokana
0
220
英語文法から学ぶ、クリーンな設計の秘訣
newnomad
1
270
CRE Meetup!ユーザー信頼性を支えるエンジニアリング実践例の発表資料です
tmnb
0
390
WordPress Playground for Developers
iambherulal
0
120
RubyKaigiで手に入れた HHKB Studioのための HIDRawドライバ
iberianpig
0
1k
‘무차별 LGTM~👍’만 외치던 우리가 ‘고봉밥 코드 리뷰’를?
hannah0731
0
530
リアクティブシステムの変遷から理解するalien-signals / Learning alien-signals from the evolution of reactive systems
yamanoku
2
1.1k
複数ドメインに散らばってしまった画像…! 運用中のPHPアプリに後からCDNを導入する…!
suguruooki
0
440
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2.1k
Music & Morning Musume
bryan
46
6.4k
Adopting Sorbet at Scale
ufuk
75
9.3k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
320
Statistics for Hackers
jakevdp
798
220k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
17
1.1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.5k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
The Invisible Side of Design
smashingmag
299
50k
Thoughts on Productivity
jonyablonski
69
4.5k
Designing for humans not robots
tammielis
251
25k
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?