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
58
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
92
PHP Moderno
jonataa
0
82
TemDendê: Desenvolvimento PHP a Moda Baiana
jonataa
0
34
Programação Reativa com RxJS
jonataa
0
110
O que esperar de um profissional de TI
jonataa
0
33
A onda agora é função como serviço
jonataa
0
28
Programação Funcional com Acarajé e Dendê
jonataa
0
50
Curso de Programação Funcional com JavaScript
jonataa
0
130
5 motivos para você participar de eventos
jonataa
0
140
Other Decks in Technology
See All in Technology
Terraformあれやこれ/terraform-this-and-that
emiki
8
1.3k
複雑な構成要素を持つUIとの向き合い方 〜新・支出グラフでの実例〜 / B43 TECH TALK
nakamuuu
0
130
最近たまに見かけるTiDBってなんだ? - Findy
pingcap0315
2
730
小さな開発会社がWebサービスを作る理由
polidog
PRO
1
180
Oracle Cloud Infrastructure:2024年4月度サービス・アップデート
oracle4engineer
PRO
1
170
プロトタイピングによる不確実性の低減 / Reducing Uncertainty through Prototyping
ohbarye
5
370
AWS を使う上で知っておきたいオンプレミス知識/aws-on-premise-essentials
emiki
1
4.3k
EMとして2023年度に頑張ったこと / What we did well in FY2023 as a EM
pauli
1
130
サーバー間 GraphQL と webmock-graphql の話 / server-to-server graphql and webmock-graphql
qsona
2
170
Hands-on Gemini, the Google DeepMind LLM
meteatamel
1
110
Discord とビルダー&チャットボットの使い方 / How to use Discord and Builder & Chatbots
ks91
PRO
0
160
**強い**エンジニアのなり方 - フィードバックサイクルを勝ち取る / grow one day each day
soudai
64
18k
Featured
See All Featured
Code Review Best Practice
trishagee
54
15k
Optimising Largest Contentful Paint
csswizardry
7
2.3k
StorybookのUI Testing Handbookを読んだ
zakiyama
12
4.6k
Building an army of robots
kneath
300
41k
The Straight Up "How To Draw Better" Workshop
denniskardys
227
130k
jQuery: Nuts, Bolts and Bling
dougneiner
59
7.1k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
16
1.4k
Bootstrapping a Software Product
garrettdimon
PRO
301
110k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
186
16k
Facilitating Awesome Meetings
lara
41
5.6k
Clear Off the Table
cherdarchuk
83
310k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
60
14k
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