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
160
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
49
All aboard the Service Bus @ ZGPHP
robertbasic
0
320
All aboard the Service Bus
robertbasic
1
280
Build your career one contribution at a time
robertbasic
0
120
Profilisanje koda sa Xdebug i KCachegrind
robertbasic
1
170
Mockery
robertbasic
1
660
Zend Framework 2
robertbasic
4
320
Introduction to Zend Framework 1
robertbasic
2
230
Other Decks in Programming
See All in Programming
Effect の双対、Coeffect
yukikurage
5
1.4k
Blazing Fast UI Development with Compose Hot Reload (droidcon New York 2025)
zsmb
1
190
Julia という言語について (FP in Julia « SIDE: F ») for 関数型まつり2025
antimon2
3
980
アンドパッドの Go 勉強会「 gopher 会」とその内容の紹介
andpad
0
260
FormFlow - Build Stunning Multistep Forms
yceruto
1
190
Benchmark
sysong
0
250
A2A プロトコルを試してみる
azukiazusa1
2
1.1k
なぜ「共通化」を考え、失敗を繰り返すのか
rinchoku
1
470
Elixir で IoT 開発、 Nerves なら簡単にできる!?
pojiro
1
150
Azure AI Foundryではじめてのマルチエージェントワークフロー
seosoft
0
120
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
330
「ElixirでIoT!!」のこれまでとこれから
takasehideki
0
370
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
Building a Modern Day E-commerce SEO Strategy
aleyda
41
7.3k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
48
5.4k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Practical Orchestrator
shlominoach
188
11k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Automating Front-end Workflow
addyosmani
1370
200k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
490
Building Adaptive Systems
keathley
43
2.6k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
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?