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
110
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.4k
Build your career one contribution at a time
robertbasic
1
35
All aboard the Service Bus @ ZGPHP
robertbasic
0
240
All aboard the Service Bus
robertbasic
1
270
Build your career one contribution at a time
robertbasic
0
110
Profilisanje koda sa Xdebug i KCachegrind
robertbasic
1
140
Mockery
robertbasic
1
420
Zend Framework 2
robertbasic
4
290
Introduction to Zend Framework 1
robertbasic
2
150
Other Decks in Programming
See All in Programming
PHPの次期バージョンはこの時期どうなっているのか - Internalsの開発体制について - PHPカンファレンス小田原
youkidearitai
PRO
1
190
PHPはいつから死んでいるかの調査
chiroruxx
1
380
ADRを一年運用してみた/adr_after_a_year
hanhan1978
7
2.3k
Rethinking UI building strategies @ SFI 2024
letelete
0
270
Goのエラースタックトレースの歴史と今後
sonatard
7
1.1k
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
360
入門 AWS Amplify Gen2 / Introduction to AWS Amplify Gen2
genkiogasawara
1
330
try! Swift Tokyo 初参加報告LT
hinakko2
0
220
DMMプラットフォームがTiDB Cloudを採用した背景
pospome
8
4k
Ruby Function Composition
bkuhlmann
1
330
try! Swift Tokyo 2024 参加報告 / try! Swift Tokyo 2024 Report
hironytic
0
200
[技育CAMPアカデミア]アイディアを形に!【超入門】スマホアプリ開発〜リリースまでの流れをご紹介
teamlab
PRO
0
360
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
243
12k
Debugging Ruby Performance
tmm1
70
11k
WebSockets: Embracing the real-time Web
robhawkes
59
7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
155
14k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
221
21k
The Cult of Friendly URLs
andyhume
74
5.7k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
Typedesign – Prime Four
hannesfritz
36
2.1k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
227
16k
In The Pink: A Labor of Love
frogandcode
138
21k
Side Projects
sachag
451
41k
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?