$30 off During Our Annual Pro Sale. View Details »
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
65
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
51
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
60
Curso de Programação Funcional com JavaScript
jonataa
0
160
5 motivos para você participar de eventos
jonataa
0
150
Other Decks in Technology
See All in Technology
AI駆動開発における設計思想 認知負荷を下げるフロントエンドアーキテクチャ/ 20251211 Teppei Hanai
shift_evolve
PRO
2
310
「Managed Instances」と「durable functions」で広がるAWS Lambdaのユースケース
lamaglama39
0
290
eBPFとwaruiBPF
sat
PRO
4
2.5k
Kubernetes Multi-tenancy: Principles and Practices for Large Scale Internal Platforms
hhiroshell
0
120
コミューンのデータ分析AIエージェント「Community Sage」の紹介
fufufukakaka
0
470
ブロックテーマとこれからの WordPress サイト制作 / Toyama WordPress Meetup Vol.81
torounit
0
540
モダンデータスタック (MDS) の話とデータ分析が起こすビジネス変革
sutotakeshi
0
450
Gemini でコードレビュー知見を見える化
zozotech
PRO
1
240
直接メモリアクセス
koba789
0
290
MapKitとオープンデータで実現する地図情報の拡張と可視化
zozotech
PRO
1
130
評価駆動開発で不確実性を制御する - MLflow 3が支えるエージェント開発
databricksjapan
1
110
Challenging Hardware Contests with Zephyr and Lessons Learned
iotengineer22
0
170
Featured
See All Featured
Embracing the Ebb and Flow
colly
88
4.9k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
GraphQLとの向き合い方2022年版
quramy
50
14k
Side Projects
sachag
455
43k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
Code Review Best Practice
trishagee
74
19k
Raft: Consensus for Rubyists
vanstee
141
7.2k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
700
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
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