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
200
0
Share
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.7k
Build your career one contribution at a time
robertbasic
1
73
All aboard the Service Bus @ ZGPHP
robertbasic
0
400
All aboard the Service Bus
robertbasic
1
320
Build your career one contribution at a time
robertbasic
0
150
Profilisanje koda sa Xdebug i KCachegrind
robertbasic
1
210
Mockery
robertbasic
1
800
Zend Framework 2
robertbasic
4
350
Introduction to Zend Framework 1
robertbasic
2
270
Other Decks in Programming
See All in Programming
新規プロダクトを高速で生み出すハーネスエンジニアリング
seanchas116
17
7.6k
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
290
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
220
今さら聞けないCancellationToken
htkym
0
210
プラグインで拡張される Context をtype-safe にする難しさと設計判断
kazupon
2
480
RailsTokyo 2026#4: AI様があれば、 Hotwireの弱点は消えるか?
naofumi
5
1k
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
540
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
6
1.8k
GitHub Copilot CLIのいいところ
htkym
2
1.2k
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
220
TSKaigi2026-静的解析への投資がAI時代のコード品質を支える ── カスタムESLintルールの設計と運用
hayatokudou
7
1.3k
権限チェックの一貫性を型で守る TypeScript による多層防御
mnch
4
980
Featured
See All Featured
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
200
Building Applications with DynamoDB
mza
96
7.1k
Leo the Paperboy
mayatellez
7
1.8k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
240
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
WENDY [Excerpt]
tessaabrams
11
38k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
220
エンジニアに許された特別な時間の終わり
watany
107
240k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
390
Amusing Abliteration
ianozsvald
1
190
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
190
Automating Front-end Workflow
addyosmani
1370
210k
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?