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
45
Programação Reativa com RxJS
jonataa
0
130
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
150
5 motivos para você participar de eventos
jonataa
0
150
Other Decks in Technology
See All in Technology
AIとTDDによるNext.js「隙間ツール」開発の実践
makotot
6
710
モダンな現場と従来型の組織——そこに生じる "不整合" を解消してこそチームがパフォーマンスを発揮できる / Team-oriented Organization Design 20250825
mtx2s
6
620
Oracle Base Database Service:サービス概要のご紹介
oracle4engineer
PRO
2
20k
DeNA での思い出 / Memories at DeNA
orgachem
PRO
3
1.6k
Amazon Bedrock AgentCore でプロモーション用動画生成エージェントを開発する
nasuvitz
6
440
Webアクセシビリティ入門
recruitengineers
PRO
1
370
マイクロモビリティシェアサービスを支える プラットフォームアーキテクチャ
grimoh
1
240
Understanding Go GC #coefl_go_jp
bengo4com
0
1.1k
Go で言うところのアレは TypeScript で言うとコレ / Kyoto.なんか #7
susisu
7
1.9k
AIエージェントの開発に必須な「コンテキスト・エンジニアリング」とは何か──プロンプト・エンジニアリングとの違いを手がかりに考える
masayamoriofficial
0
410
[CV勉強会@関東 CVPR2025 読み会] MegaSaM: Accurate, Fast, and Robust Structure and Motion from Casual Dynamic Videos (Li+, CVPR2025)
abemii
0
200
夢の印税生活 / Life on Royalties
tmtms
0
290
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
The Art of Programming - Codeland 2020
erikaheidi
55
13k
How to Think Like a Performance Engineer
csswizardry
25
1.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
6k
Designing for humans not robots
tammielis
253
25k
Reflections from 52 weeks, 52 projects
jeffersonlam
351
21k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
1k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.4k
Designing for Performance
lara
610
69k
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