Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
50
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
59
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
pmconf2025 - 他社事例を"自社仕様化"する技術_iRAFT法
daichi_yamashita
0
540
Microsoft Agent 365 を 30 分でなんとなく理解する
skmkzyk
1
320
著者と読み解くAIエージェント現場導入の勘所 Lancers TechBook#2
smiyawaki0820
10
3.4k
AI 時代のデータ戦略
na0
8
3.3k
Docker, Infraestructuras seguras y Hardening
josejuansanchez
0
150
freeeにおけるファンクションを超えた一気通貫でのAI活用
jaxx2104
3
830
ページの可視領域を算出する方法について整理する
yamatai1212
0
160
Master Dataグループ紹介資料
sansan33
PRO
1
4k
オープンデータの内製化から分かったGISデータを巡る行政の課題
naokim84
2
1.4k
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
5
48k
AI駆動開発によるDDDの実践
dip_tech
PRO
0
290
プロダクトマネジメントの分業が生む「デリバリーの渋滞」を解消するTPMの越境
recruitengineers
PRO
3
460
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
697
190k
Navigating Team Friction
lara
191
16k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.3k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
How to Think Like a Performance Engineer
csswizardry
28
2.3k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
1
80
Building a Scalable Design System with Sketch
lauravandoore
463
34k
The Pragmatic Product Professional
lauravandoore
37
7.1k
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