Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Code profiling with Xdebug and Kcachegrind
Search
robertbasic
January 28, 2017
Programming
220
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
88
All aboard the Service Bus @ ZGPHP
robertbasic
0
420
All aboard the Service Bus
robertbasic
1
340
Build your career one contribution at a time
robertbasic
0
160
Profilisanje koda sa Xdebug i KCachegrind
robertbasic
1
230
Mockery
robertbasic
4
860
Zend Framework 2
robertbasic
4
360
Introduction to Zend Framework 1
robertbasic
2
290
Other Decks in Programming
See All in Programming
プロダクトコードからライブラリの境界を見つける
elmetal
PRO
0
100
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
190
Are APIs Still Relevant in the AI Era?
soyuka
0
420
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
7
2.4k
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1.1k
Rでドレミ/Do-Re-Mi_with_R
florets1
0
120
速習iPhone Duo対応
yuukiw00w
2
960
Domain-Driven Transformation
hschwentner
2
2.3k
JRuby: Past, Present, and Future
headius
0
220
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
440
残高管理から台帳サービスへの進化
artoy
0
140
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
310
Featured
See All Featured
The Language of Interfaces
destraynor
162
27k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
KATA
mclloyd
PRO
35
16k
How to train your dragon (web standard)
notwaldorf
96
6.8k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
Code Reviewing Like a Champion
maltzj
528
40k
First, design no harm
axbom
PRO
2
1.3k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
860
Navigating Team Friction
lara
192
16k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
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?