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
Medindo a Performance de Códigos PHP
Search
Jonata Weber
November 25, 2016
Technology
75
0
Share
Medindo a Performance de Códigos PHP
Jonata Weber
November 25, 2016
More Decks by Jonata Weber
See All by Jonata Weber
PHPStan - Analisador Estático
jonataa
0
120
PHP Moderno
jonataa
0
110
TemDendê: Desenvolvimento PHP a Moda Baiana
jonataa
0
61
Programação Reativa com RxJS
jonataa
0
150
O que esperar de um profissional de TI
jonataa
0
44
A onda agora é função como serviço
jonataa
0
37
Programação Funcional com Acarajé e Dendê
jonataa
0
65
Curso de Programação Funcional com JavaScript
jonataa
0
180
5 motivos para você participar de eventos
jonataa
0
160
Other Decks in Technology
See All in Technology
目的ファーストのハーネス設計 ~ハーネスの変更容易性を高めるための優先順位~
gotalab555
7
1.9k
The Journey of Box Building
tagomoris
4
300
Data Hubグループ 紹介資料
sansan33
PRO
0
2.9k
2026年、知っておくべき最新 サーバレスTips10選/serverless-10-tips
slsops
13
5k
「責任あるAIエージェント」こそ自社で開発しよう!
minorun365
9
1.6k
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.4k
JEDAI in Osaka 2026イントロ
taka_aki
0
260
マルチエージェント × ハーネスエンジニアリング × GitLab Duo Agent Platformで実現する「AIエージェントに仕事をさせる時代へ。」 / 20260421 GitLab Duo Agent Platform
n11sh1
0
130
みんなで作るAWS Tips 100連発 (FinOps編)
schwrzktz
1
260
QGISプラグイン CMChangeDetector
naokimuroki
1
340
最新の脅威動向から考える、コンテナサプライチェーンのリスクと対策
kyohmizu
1
650
実践ハーネスエンジニアリング:TAKTで実現するAIエージェント制御 / Practical Harness Engineering: AI Agent Control Enabled by TAKT
nrslib
9
3.9k
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
1
340
Mind Mapping
helmedeiros
PRO
1
150
Navigating Weather and Climate Data
rabernat
0
170
New Earth Scene 8
popppiees
3
2.1k
Abbi's Birthday
coloredviolet
2
7k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
98
The Cult of Friendly URLs
andyhume
79
6.8k
Building AI with AI
inesmontani
PRO
1
900
What does AI have to do with Human Rights?
axbom
PRO
1
2.1k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
320
First, design no harm
axbom
PRO
2
1.2k
Scaling GitHub
holman
464
140k
Transcript
Medindo a Performance de Códigos PHP Por Jonata Weber
@JonataWeber
www.app2sales.com
None
Performance Computer performance is the amount of work accomplished by
a computer system.
Aspects of performance • Availability • Response Time • Processing
Speed • Latency • Bandwidth • Throughtput • Scalability
Pick any two Cheap Good Fast
Development vs Production
Tools
Faker
Profile Before Optimizing
$then = microtime(); myFunc(); $now = microtime(); echo sprintf("Elapsed: %f",
$now - $then); There's a better way, right? :)
Apache Benchmarking $ ab -n 100 -c 10 http://localhost:8000
HTTP Benchmarking $ wrk -t12 -c400 -d30s http://localhost:8000
Testing High Availability
Load testing tool
None
Profiling
None
Install the xdebug $ pecl install xdebug
Starting the Profiler (php.ini) xdebug.profiler_enable=1 xdebug.profiler_output_dir xdebug.profiler_enable_trigger=1 More informations: https://xdebug.org/docs/profiler
Profiler Viewer
Profiler Viewer (in the browser)
Flame Graphs
XHProf: A Hierarchical Profiler for PHP
None
None
None
None
Demo
Problemas comuns
Problemas comuns • Arquitetura • Workload
Arquitetura • Sem cache; • Hardware mal dimensionado; • Aplicação
single thread; • Latência de rede não prevista.
Workload • Mais usuários que o esperado; • Cache mal
planejado.
Otimização precoce, fazer ou não fazer, eis a questão.
YAGNI You Aren't Gonna Need It
Mas, as vezes é preciso!
Make work. Make right. Make fast.
O que não pode ser medido não pode ser melhorado.
Esteja pronto, sempre!
None
Obrigado! @JonataWeber
Referências https://speakerdeck.com/tarsisazevedo/performance-analysis-101 http://wiki.c2.com/?PrematureOptimization http://wiki.c2.com/?ProfileBeforeOptimizing http://wiki.c2.com/?MakeItWorkMakeItRightMakeItFast