Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Profiling PHP @ PHPCon Poland 2016
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Sebastian Grodzicki
October 01, 2016
Technology
730
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Profiling PHP @ PHPCon Poland 2016
PHPCon Poland 2016
http://www.phpcon.pl/2016/pl/
Sebastian Grodzicki
October 01, 2016
More Decks by Sebastian Grodzicki
See All by Sebastian Grodzicki
Fault-tolerant workflow orchestration in PHP @ PHPCon Poland 2024
sgrodzicki
0
180
PHP w Google Cloud @ PHPCon Poland 2022
sgrodzicki
0
54
Elasticsearch + Symfony @ SymfonyLive Online Polish Edition 2021
sgrodzicki
0
200
Elasticsearch + Symfony @ WDI 2021
sgrodzicki
0
71
Combining Logs, Metrics, and Traces for Unified Observability @ Infoshare 2020
sgrodzicki
0
570
Building Distributed Systems in Distributed Teams @ Infoshare 2020
sgrodzicki
0
97
Building Distributed Systems in Distributed Teams @ 4Developers 2020
sgrodzicki
0
95
Building Distributed Systems in Distributed Teams @ DevOpsDay Warsaw 2019
sgrodzicki
0
77
Infrastructure as Code @ DevOpsDay Warsaw 2019
sgrodzicki
0
100
Other Decks in Technology
See All in Technology
ソフトウェアDNAとクラウドエージェントのススメ
cloudace
0
110
TinyGo 開発サイクルを高速化する:Go で作るエミュレータ入門
zozotech
PRO
1
740
ユーザー価値を届け続けるためにウォンテッドリーが大切にしている文化
kotaminato
0
160
Reactの設計論
uhyo
24
13k
開発投資の期待値を上げるプロダクトロードマップづくり ~プロダクトエンジニアが越境して事業を伸ばす~
kekekenta
1
180
OpenTelemetryのメトリクスをCloudWatchに送ってPromQLで見てみた
ota1022
0
150
新機種発売前に見直そう!端末移行で再ログインが要るアプリ・要らないアプリは何が違うのか 〜シームレスに再開できる設計と実装〜
zozotech
PRO
0
200
越境するなら専門用語を使うな高校校歌 / If you wanna cross border, you shouldn't use jargon
vtryo
0
140
アクセスキーこわい やめかたと漏らさない工夫
sassssan68
1
240
AI に書かせたその API、 “信頼” できますか?
nagix
0
110
10Xに技術的負債をもたらした「2つの境界の歪み」その構造と解消への営み
10xinc
0
1.9k
beyond jj: config & tools ecosystem
indirect
0
430
Featured
See All Featured
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
880
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
430
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
540
A designer walks into a library…
pauljervisheath
211
25k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
A better future with KSS
kneath
240
18k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.9k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
330
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.2k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Navigating Weather and Climate Data
rabernat
0
520
Transcript
PROFILING PHP SEBASTIAN GRODZICKI
WHO USES PHP?
WHO USES PHP 7?
WHO USES PHPUNIT?
WHO USES XDEBUG?
WHO USES BLACKFIRE?
SEBASTIAN GRODZICKI CTO @ SHOWROOM
I’M NOT HIRED BY BLACKFIRE. Sebastian Grodzicki DISCLAIMER
40% OF USERS ABANDON A WEBSITE THAT TAKES MORE THAN
3 SECONDS TO LOAD Akamai STATISTICS
PROFILING IS A WAY TO MEASURE WHERE A PROGRAM SPENDS
TIME MathWorks DEFINITION
MICROTIME
log_format foobar '$remote_addr ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent"
' '$request_time $upstream_response_time’; access_log /var/log/nginx/access.log foobar; NGINX
Xdebug
xdebug.profiler_enable_trigger = 1 http://url?XDEBUG_PROFILE=1
KCACHEGRIND
PROFILING PHP WEBGRIND
XHProf
<?php xhprof_enable(); # do some stuff $xhprof_data = xhprof_disable();
XHPROF
None
None
PROFILING PHP TIME Wall time I/O CPU Disk I/O Network
= = + +
PROFILING PHP INCLUSIVE VS EXCLUSIVE TIME function foo() { $str
= bar(); return $str; } function foo() { $str = bar(); return $str; }
BLACKFIRE CONTINUOUS PERFORMANCE TESTING
BLACKFIRE CALLGRAPHS
BLACKFIRE HOT PATHS
DEMO CHROME COMPANION
None
None
DEMO BLACKFIRE CURL
None
DEMO BLACKFIRE RUN
None
None
ASSERTIONS
PROFILING PHP ASSERTIONS tests: "Application should never hit the DB":
path: "/.*" assertions: - "metrics.sql.queries.count == 0"
PROFILING PHP ASSERTIONS tests: "Homepage should never call the API":
path: "/" assertions: - "metrics.http.requests.count == 0"
PROFILING PHP ASSERTIONS tests: "Pages should be fast enough": path:
"/.*" assertions: - "main.wall_time < 100ms"
None
BUILDS
None
None
None
PHP SDK
BLACKFIRE PHP SDK ▸ composer require blackfire/php-sdk ▸ $blackfire =
new \Blackfire\Client(); ▸ $probe = $blackfire->createProbe(); ▸ $profile = $blackfire->endProbe($probe);
PHPUNIT
<?php use Blackfire\Bridge\PhpUnit\TestCaseTrait; use Blackfire\Profile; class IntegrationTest extends
\PHPUnit_Framework_TestCase { use TestCaseTrait; /** * @requires extension blackfire */ public function testSomething() { $config = new Profile\Configuration(); $config ->assert('metrics.sql.queries.count < 5', 'SQL queries') ->assert('metrics.twig.render.count < 3', 'Rendered Twig templates') ->assert('metrics.twig.compile.count == 0', 'Twig compilation') ; } }
blackfire.io/docs/24-days
QUESTIONS?
THANK YOU!