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
74
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
58
Programação Reativa com RxJS
jonataa
0
140
O que esperar de um profissional de TI
jonataa
0
42
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
180
5 motivos para você participar de eventos
jonataa
0
150
Other Decks in Technology
See All in Technology
競争優位を生み出す戦略的内製開発の実践技法
masuda220
PRO
2
520
AI活用を"目的"にしたら、データの本質が見えてきた - Snowflake Intelligence実験記 / chasing-ai-finding-data
pei0804
0
850
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
ヘルシーSRE
tk3fftk
2
210
技術キャッチアップ効率化を実現する記事推薦システムの構築
yudai00
2
160
Oracle Cloud Infrastructure:2026年2月度サービス・アップデート
oracle4engineer
PRO
0
130
opsmethod第1回_アラート調査の自動化にむけて
yamatook
0
330
AWS Bedrock Guardrails / 機密情報の入力・出力をブロックする — Blocking Sensitive Information Input/Output
kazuhitonakayama
2
190
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
3k
LINEアプリ開発のための Claude Code活用基盤の構築
lycorptech_jp
PRO
1
1.2k
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
95k
OCI技術資料 : 外部接続 VPN接続 詳細
ocise
1
10k
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
190
My Coaching Mixtape
mlcsv
0
63
The World Runs on Bad Software
bkeepers
PRO
72
12k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
95
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
60
42k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.1k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.4k
Test your architecture with Archunit
thirion
1
2.2k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.3k
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