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
0
71
Medindo a Performance de Códigos PHP
Jonata Weber
November 25, 2016
Tweet
Share
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
54
Programação Reativa com RxJS
jonataa
0
140
O que esperar de um profissional de TI
jonataa
0
39
A onda agora é função como serviço
jonataa
0
33
Programação Funcional com Acarajé e Dendê
jonataa
0
60
Curso de Programação Funcional com JavaScript
jonataa
0
170
5 motivos para você participar de eventos
jonataa
0
150
Other Decks in Technology
See All in Technology
ALB「証明書上限問題」からの脱却
nishiokashinji
0
230
Vivre en Bitcoin : le tutoriel que votre banquier ne veut pas que vous voyiez
rlifchitz
0
340
Master Dataグループ紹介資料
sansan33
PRO
1
4.2k
Web Intelligence and Visual Media Analytics
weblyzard
PRO
1
6.8k
AWS監視を「もっと楽する」ために
uechishingo
0
190
Kiro Power - Amazon Bedrock AgentCore を学ぶ、もう一つの方法
r3_yamauchi
PRO
0
110
Data Hubグループ 紹介資料
sansan33
PRO
0
2.6k
多様な最適化サービス開発をスケールさせる共通基盤とチーム構成
algoartis
0
110
歴史から学ぶ、Goのメモリ管理基礎
logica0419
14
2.9k
20260114_データ横丁 新年LT大会:2026年の抱負
taromatsui_cccmkhd
0
360
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
みんなでAI上手ピーポーになろう! / Let’s All Get AI-Savvy!
kaminashi
0
170
Featured
See All Featured
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
49
GraphQLとの向き合い方2022年版
quramy
50
14k
Amusing Abliteration
ianozsvald
0
87
Discover your Explorer Soul
emna__ayadi
2
1k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
230
The World Runs on Bad Software
bkeepers
PRO
72
12k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
290
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.9k
We Are The Robots
honzajavorek
0
140
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
For a Future-Friendly Web
brad_frost
181
10k
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