Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Code profiling with Xdebug and Kcachegrind
robertbasic
January 28, 2017
Programming
0
87
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
950
Build your career one contribution at a time
robertbasic
1
28
All aboard the Service Bus @ ZGPHP
robertbasic
0
150
All aboard the Service Bus
robertbasic
1
250
Build your career one contribution at a time
robertbasic
0
100
Profilisanje koda sa Xdebug i KCachegrind
robertbasic
1
130
Mockery
robertbasic
1
240
Zend Framework 2
robertbasic
4
290
Introduction to Zend Framework 1
robertbasic
2
120
Other Decks in Programming
See All in Programming
There's an API for that!
mariatta
PRO
0
100
それ全部エラーメッセージに書いてあるよ!〜独学でPHPプログラミングが上達するたった一つの方法〜
77web
1
150
料理の注文メニューの3D化への挑戦
hideg
0
280
JetpackCompose 導入半年で感じた 改善点
spbaya0141
0
140
アジャイルで不確実性に向き合うための開発タスクの切り方
tanden
4
1.1k
リーダブルテストコード / #vstat
jnchito
46
34k
Pythonによる開発をアップデートするライブラリの紹介
daikikatsuragawa
1
330
Lookerとdbtの共存
ttccddtoki
0
620
Isar勉強会
hoddy3190
0
330
kintone × LINE Bot で餃子検定Botを作った話
naberina
0
300
僕が便利だと感じる Snow Monkey の特徴/20220723_Gifu_WordPress_Meetup
oleindesign
0
100
20220706_Google Apps Scriptを実演で学ぶ~ GAS × Slack ~
apachan
2
610
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
316
19k
What's in a price? How to price your products and services
michaelherold
229
9.4k
Debugging Ruby Performance
tmm1
65
10k
Rebuilding a faster, lazier Slack
samanthasiow
62
7.3k
Teambox: Starting and Learning
jrom
123
7.7k
Three Pipe Problems
jasonvnalue
89
8.7k
Code Review Best Practice
trishagee
44
9.7k
Six Lessons from altMBA
skipperchong
14
1.4k
Documentation Writing (for coders)
carmenintech
48
2.6k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
21
1.4k
We Have a Design System, Now What?
morganepeng
35
3k
Atom: Resistance is Futile
akmur
255
20k
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?