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
170
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.7k
Build your career one contribution at a time
robertbasic
1
52
All aboard the Service Bus @ ZGPHP
robertbasic
0
320
All aboard the Service Bus
robertbasic
1
290
Build your career one contribution at a time
robertbasic
0
120
Profilisanje koda sa Xdebug i KCachegrind
robertbasic
1
180
Mockery
robertbasic
1
690
Zend Framework 2
robertbasic
4
320
Introduction to Zend Framework 1
robertbasic
2
240
Other Decks in Programming
See All in Programming
[Codecon - 2025] Como não odiar seus testes
camilacampos
0
100
ソフトウェア設計とAI技術の活用
masuda220
PRO
25
7.2k
Strands Agents で実現する名刺解析アーキテクチャ
omiya0555
1
110
DynamoDBは怖くない!〜テーブル設計の勘所とテスト戦略〜
hyamazaki
0
150
はじめてのWeb API体験 ー 飲食店検索アプリを作ろうー
akinko_0915
0
180
抽象化という思考のツール - 理解と活用 - / Abstraction-as-a-Tool-for-Thinking
shin1x1
1
910
PHPカンファレンス関西2025 基調講演
sugimotokei
6
1.1k
バイブコーディングの正体——AIエージェントはソフトウェア開発を変えるか?
stakaya
5
610
階層化自動テストで開発に機動力を
ickx
1
460
[DevinMeetupTokyo2025] コード書かせないDevinの使い方
takumiyoshikawa
2
250
decksh - a little language for decks
ajstarks
4
21k
副作用と戦う PHP リファクタリング ─ ドメインイベントでビジネスロジックを解きほぐす
kajitack
3
510
Featured
See All Featured
Designing for humans not robots
tammielis
253
25k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
The Art of Programming - Codeland 2020
erikaheidi
54
13k
Art, The Web, and Tiny UX
lynnandtonic
301
21k
Documentation Writing (for coders)
carmenintech
73
4.9k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
5.9k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Become a Pro
speakerdeck
PRO
29
5.5k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
730
Automating Front-end Workflow
addyosmani
1370
200k
Facilitating Awesome Meetings
lara
54
6.5k
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?