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
310
Introduction to Zend Framework 1
robertbasic
2
230
Other Decks in Programming
See All in Programming
事業戦略を理解してソフトウェアを設計する
masuda220
PRO
21
5.9k
KotlinConf 2025 現地で感じたServer-Side Kotlin
n_takehata
1
200
Datadog RUM 本番導入までの道
shinter61
1
250
技術懸念に立ち向かい 法改正を穏便に乗り切った話
pop_cashew
0
1.3k
漸進。
ssssota
0
1.8k
Spring gRPC で始める gRPC 入門 / Introduction to gRPC with Spring gRPC
mackey0225
2
480
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
170
イベントストーミングから始めるドメイン駆動設計
jgeem
4
810
Development of an App for Intuitive AI Learning - Blockly Summit 2025
teba_eleven
0
110
AIエージェントによるテストフレームワーク Arbigent
takahirom
0
370
GoのWebAssembly活用パターン紹介
syumai
3
9.9k
OpenNext + Hono on Cloudflare でイマドキWeb開発スタックを実現する
rokuosan
0
120
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
245
12k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.3k
We Have a Design System, Now What?
morganepeng
52
7.6k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
The Cost Of JavaScript in 2023
addyosmani
50
8.3k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
43
2.4k
A Modern Web Designer's Workflow
chriscoyier
693
190k
The Cult of Friendly URLs
andyhume
79
6.4k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
123
52k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
2.8k
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?