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
Medindo a Performance de Códigos PHP
Search
Jonata Weber
November 25, 2016
Technology
80
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Medindo a Performance de Códigos PHP
Jonata Weber
November 25, 2016
Transcript
43 slides
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
More Decks by Jonata Weber
See All by Jonata Weber
PHPStan - Analisador Estático
jonataa
0
130
PHP Moderno
jonataa
0
120
TemDendê: Desenvolvimento PHP a Moda Baiana
jonataa
0
65
Programação Reativa com RxJS
jonataa
0
150
O que esperar de um profissional de TI
jonataa
0
59
A onda agora é função como serviço
jonataa
0
44
Programação Funcional com Acarajé e Dendê
jonataa
0
84
Curso de Programação Funcional com JavaScript
jonataa
0
190
5 motivos para você participar de eventos
jonataa
0
160
Other Decks in Technology
See All in Technology
令和の今、あらためて IAM を考える。アクセスキーを「無くせない現実」との向き合い方
kazzpapa3
0
680
高品質と高スピードを支える品質のシフトレフトのアプローチ
goyoki
2
780
あの日、見つかっていなかったらどうなっていたか
kazzpapa3
2
170
Claude Codeで作ったアプリを安全に公開する/Built with Claude Japan 2026
yoshidashingo
0
240
Kiro IDE 入門 (画面の各部から、頼み方、任せ方、戻し方まで) | 目指せ Kiro マスター 02
inariku
PRO
4
230
Active Directory と Entra ID のむむむな関係
murachiakira
PRO
4
1.8k
DevOps Agentにあらゆるセキュリティインシデントのトリアージを任せた件
jirtosterone
1
130
E2E Test というハーネス — AI時代の自動テスト民主化
daishukojima
1
370
AI対話型分析を作成し、リリースするまでの話 / The Road to Release: Buiding AI Conversational Analytics
yappli_developers
0
100
Microsoft Entra Kerberos で実現するクラウド デバイス管理
tamaiyutaro
2
680
Frontier Teams — Amazon は AI で「開発のやり方」をどう変えたのか
kmotohas
0
220
LLM 基盤と kagent v0 を全部 k8s に入れてみた / Deploy both LLM and kagent v0 in k8s
kota2and3kan
0
180
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1370
210k
GraphQLとの向き合い方2022年版
quramy
50
15k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
400
How to train your dragon (web standard)
notwaldorf
96
6.9k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.6k
Raft: Consensus for Rubyists
vanstee
143
7.9k
エンジニアに許された特別な時間の終わり
watany
109
250k
Writing Fast Ruby
sferik
630
63k
Deep Space Network (abreviated)
tonyrice
0
410
Building Better People: How to give real-time feedback that sticks.
wjessup
371
20k
Design in an AI World
tapps
1
390
GitHub's CSS Performance
jonrohan
1033
470k