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
62
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
100
TemDendê: Desenvolvimento PHP a Moda Baiana
jonataa
0
42
Programação Reativa com RxJS
jonataa
0
120
O que esperar de um profissional de TI
jonataa
0
37
A onda agora é função como serviço
jonataa
0
32
Programação Funcional com Acarajé e Dendê
jonataa
0
55
Curso de Programação Funcional com JavaScript
jonataa
0
140
5 motivos para você participar de eventos
jonataa
0
150
Other Decks in Technology
See All in Technology
実践Kafka Streams 〜イベント駆動型アーキテクチャを添えて〜
joker1007
3
830
大手企業のAIツール導入の壁を越えて:サイバーエージェントのCursor活用戦略
gunta
34
17k
プロジェクトマネージャーに最後まで残るたった一つの仕事は交渉
ichimichi
1
180
やさしい認証認可
minorun365
PRO
26
10k
Spring for GraphQLって実際どうなの?〜小規模スタートアップの事例紹介〜
kogayushi
0
160
Autonomous Database サービス・アップデート (FY25)
oracle4engineer
PRO
1
730
現場で役立つAPIデザイン
nagix
1
180
JavaのMCPサーバーで体験するAIエージェントの世界
tatsuya1bm
1
210
Text-to-SQLの評価データセットを作って最新LLMモデルの性能評価をしてみた
gotalab555
3
470
OpenJDKエコシステムと開発中の機能を紹介 2025夏版
chiroito
1
1.1k
20250514_未経験から Fintech実務参画まで。学生エンジニアの挑戦録
hideto1008
0
870
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
5
38k
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1370
200k
Navigating Team Friction
lara
186
15k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
Designing Experiences People Love
moore
142
24k
Practical Orchestrator
shlominoach
188
11k
How STYLIGHT went responsive
nonsquared
100
5.6k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Stop Working from a Prison Cell
hatefulcrawdad
269
20k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.5k
Site-Speed That Sticks
csswizardry
9
620
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