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
120
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
46
All aboard the Service Bus @ ZGPHP
robertbasic
0
290
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
160
Mockery
robertbasic
1
570
Zend Framework 2
robertbasic
4
300
Introduction to Zend Framework 1
robertbasic
2
200
Other Decks in Programming
See All in Programming
Cursorでアプリケーションの追加開発や保守をどこまでできるか試したら得るものが多かった話
drumnistnakano
0
290
DevTools extensions で 独自の DevTool を開発する | FlutterKaigi 2024
kokiyoshida
0
460
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
620
社内活動の取り組み紹介 ~ スリーシェイクでこんな取り組みしてます ~
bells17
0
400
第5回日本眼科AI学会総会_AIコンテスト_3位解法
neilsaw
0
140
Effective Signals in Angular 19+: Rules and Helpers @ngbe2024
manfredsteyer
PRO
0
100
【re:Growth 2024】 Aurora DSQL をちゃんと話します!
maroon1st
0
660
クリエイティブコーディングとRuby学習 / Creative Coding and Learning Ruby
chobishiba
0
3.7k
デザインパターンで理解するLLMエージェントの作り方 / How to develop an LLM agent using agentic design patterns
rkaga
12
3.5k
Cognitoが大型アップデート!Managed Loginとパスワードレスログインを実際に使ってみた@しむそくRadio Special Day1
tmhirai
3
280
Jakarta EE meets AI
ivargrimstad
0
1.1k
物流システムにおけるリファクタリングとアーキテクチャの再構築 〜依存関係とモジュール分割の重要性〜
deeprain
1
950
Featured
See All Featured
Site-Speed That Sticks
csswizardry
1
160
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
Statistics for Hackers
jakevdp
796
220k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
Making the Leap to Tech Lead
cromwellryan
133
9k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.2k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
Gamification - CAS2011
davidbonilla
80
5.1k
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?