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
63
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
100
TemDendê: Desenvolvimento PHP a Moda Baiana
jonataa
0
47
Programação Reativa com RxJS
jonataa
0
130
O que esperar de um profissional de TI
jonataa
0
38
A onda agora é função como serviço
jonataa
0
33
Programação Funcional com Acarajé e Dendê
jonataa
0
57
Curso de Programação Funcional com JavaScript
jonataa
0
150
5 motivos para você participar de eventos
jonataa
0
150
Other Decks in Technology
See All in Technology
Findy Team+のSOC2取得までの道のり
rvirus0817
0
500
Wasmのエコシステムを使った ツール作成方法
askua
0
100
OCI Network Firewall 概要
oracle4engineer
PRO
1
7.8k
【Kaigi on Rails 事後勉強会LT】MeはどうしてGirlsに? 私とRubyを繋いだRail(s)
joyfrommasara
0
200
SREとソフトウェア開発者の合同チームはどのようにS3のコストを削減したか?
muziyoshiz
1
180
Access-what? why and how, A11Y for All - Nordic.js 2025
gdomiciano
1
120
リーダーになったら未来を語れるようになろう/Speak the Future
sanogemaru
0
360
スタートアップにおけるこれからの「データ整備」
shomaekawa
2
340
これがLambdaレス時代のChatOpsだ!実例で学ぶAmazon Q Developerカスタムアクション活用法
iwamot
PRO
5
200
後進育成のしくじり〜任せるスキルとリーダーシップの両立〜
matsu0228
7
3.2k
M5製品で作るポン置きセルラー対応カメラ
sayacom
0
170
「使い方教えて」「事例教えて」じゃもう遅い! Microsoft 365 Copilot を触り倒そう!
taichinakamura
0
200
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Scaling GitHub
holman
463
140k
Building Adaptive Systems
keathley
43
2.8k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
45
2.5k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Agile that works and the tools we love
rasmusluckow
331
21k
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