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
47
All aboard the Service Bus @ ZGPHP
robertbasic
0
300
All aboard the Service Bus
robertbasic
1
270
Build your career one contribution at a time
robertbasic
0
120
Profilisanje koda sa Xdebug i KCachegrind
robertbasic
1
160
Mockery
robertbasic
1
600
Zend Framework 2
robertbasic
4
300
Introduction to Zend Framework 1
robertbasic
2
200
Other Decks in Programming
See All in Programming
『GO』アプリ バックエンドサーバのコスト削減
mot_techtalk
0
140
Unity Android XR入門
sakutama_11
0
160
ソフトウェアエンジニアの成長
masuda220
PRO
10
1.1k
密集、ドキュメントのコロケーション with AWS Lambda
satoshi256kbyte
0
190
Honoをフロントエンドで使う 3つのやり方
yusukebe
7
3.2k
富山発の個人開発サービスで日本中の学校の業務を改善した話
krpk1900
4
380
Amazon ECS とマイクロサービスから考えるシステム構成
hiyanger
2
550
第3回 Snowflake 中部ユーザ会- dbt × Snowflake ハンズオン
hoto17296
4
370
DROBEの生成AI活用事例 with AWS
ippey
0
130
PHPのバージョンアップ時にも役立ったAST
matsuo_atsushi
0
110
Pulsar2 を雰囲気で使ってみよう
anoken
0
240
WebDriver BiDiとは何なのか
yotahada3
1
140
Featured
See All Featured
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
How STYLIGHT went responsive
nonsquared
98
5.4k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Producing Creativity
orderedlist
PRO
344
39k
Agile that works and the tools we love
rasmusluckow
328
21k
A Philosophy of Restraint
colly
203
16k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
How to Ace a Technical Interview
jacobian
276
23k
Music & Morning Musume
bryan
46
6.3k
A better future with KSS
kneath
238
17k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
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?