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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
robertbasic
January 28, 2017
Programming
210
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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.8k
Build your career one contribution at a time
robertbasic
1
79
All aboard the Service Bus @ ZGPHP
robertbasic
0
410
All aboard the Service Bus
robertbasic
1
330
Build your career one contribution at a time
robertbasic
0
160
Profilisanje koda sa Xdebug i KCachegrind
robertbasic
1
220
Mockery
robertbasic
4
840
Zend Framework 2
robertbasic
4
350
Introduction to Zend Framework 1
robertbasic
2
280
Other Decks in Programming
See All in Programming
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
180
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
1
970
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
230
数百円から始めるRuby電子工作
tarosay
0
160
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
5
1.9k
リアルな遅延を測る仕様
kota_yata
1
110
React本体のコードリーディング
high_g_engineer
1
140
バグを直したら useEffect が消えた
colorful12
2
440
Laravel Boostに学ぶ、AIにPHPを書かせる技術 〜OSSの実装から蒸留するエージェント制御の王道〜
kentaroutakeda
3
710
これって Effect でできたのでは? / TSKaigi Mashup Kansai #2
susisu
0
240
わからない話を追いかけたら、プログラミング言語を作る側にいた
ydah
3
520
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
520
Featured
See All Featured
It's Worth the Effort
3n
188
29k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
210
The Pragmatic Product Professional
lauravandoore
37
7.4k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
490
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.1k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
66
57k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
The Curious Case for Waylosing
cassininazir
1
460
[SF Ruby Conf 2025] Rails X
palkan
2
1.3k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
460
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
670
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?