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
60
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
110
PHP Moderno
jonataa
0
95
TemDendê: Desenvolvimento PHP a Moda Baiana
jonataa
0
35
Programação Reativa com RxJS
jonataa
0
120
O que esperar de um profissional de TI
jonataa
0
36
A onda agora é função como serviço
jonataa
0
32
Programação Funcional com Acarajé e Dendê
jonataa
0
51
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
Oracle Cloud Infrastructure:2025年2月度サービス・アップデート
oracle4engineer
PRO
1
140
データマネジメントのトレードオフに立ち向かう
ikkimiyazaki
3
300
バックエンドエンジニアのためのフロントエンド入門 #devsumiC
panda_program
16
7k
SA Night #2 FinatextのSA思想/SA Night #2 Finatext session
satoshiimai
1
130
Developer Summit 2025 [14-D-1] Yuki Hattori
yuhattor
19
5.8k
次世代KYC活動報告 / 20250219-BizDay17-KYC-nextgen
oidfj
0
150
エンジニアのためのドキュメント力基礎講座〜構造化思考から始めよう〜(2025/02/15jbug広島#15発表資料)
yasuoyasuo
16
6.3k
転生CISOサバイバル・ガイド / CISO Career Transition Survival Guide
kanny
3
920
AndroidデバイスにFTPサーバを建立する
e10dokup
0
240
個人開発から公式機能へ: PlaywrightとRailsをつなげた3年の軌跡
yusukeiwaki
11
2.9k
レビューを増やしつつ 高評価維持するテクニック
tsuzuki817
1
480
運用しているアプリケーションのDBのリプレイスをやってみた
miura55
1
490
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
182
22k
Building Applications with DynamoDB
mza
93
6.2k
Automating Front-end Workflow
addyosmani
1367
200k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
27
1.9k
Building Your Own Lightsaber
phodgson
104
6.2k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.2k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Building Adaptive Systems
keathley
40
2.4k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
The World Runs on Bad Software
bkeepers
PRO
67
11k
Scaling GitHub
holman
459
140k
Docker and Python
trallard
44
3.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