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
Confoo 2016 - Make it Faster
Search
Guillaume Malette
February 25, 2016
Programming
49
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Confoo 2016 - Make it Faster
Guillaume Malette
February 25, 2016
More Decks by Guillaume Malette
See All by Guillaume Malette
Handling Uniqueness and Duplicates in Rails
gmalette
0
45
Simplifying Controllers - Confoo 2015
gmalette
1
93
Migrating to Single Table Inheritance
gmalette
1
94
Other Decks in Programming
See All in Programming
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
150
VibeCodingからAgenticWorkflowへ
starfish719
0
410
freeeにおけるEvalsの実践例の紹介
freee
PRO
0
110
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
320
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
270
Cloudflare is Agents
chimame
0
160
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
4
1.9k
仕様駆動開発の消費期限
watany
20
8.1k
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
1.5k
型も通る、synthも通る、それでも危ない 〜AIのCDKの権限とコストを機械で検証する〜 / It Passes Type Checks, It Passes Synth Checks, but It’s Still Risky — Automatically Verifying Permissions and Costs in AI’s CDK —
seike460
PRO
1
550
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
540
FDEが実現するAI駆動経営の現在地
gonta
2
280
Featured
See All Featured
The browser strikes back
jonoalderson
0
1.5k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
290
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.7k
How Software Deployment tools have changed in the past 20 years
geshan
1
34k
Accessibility Awareness
sabderemane
1
170
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
700
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Being A Developer After 40
akosma
91
590k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
250
Thoughts on Productivity
jonyablonski
76
5.3k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
280
Transcript
make it faster Guillaume Malette gmalette ! "
None
None
None
None
https://github.com/gmalette/Confoo2016/
we need to talk
phpbench.com
#perfmatters http://www4.akamai.com/html/about/press/releases/2009/press_091409.html https://blog.kissmetrics.com/loading-time/
slow is what? https://www.nngroup.com/articles/response-times-3-important-limits/
None
None
why is my site slow?
php php php php laravel php php php ruby rails
API sql redis memcached etc
None
benchmark identify change
benchmark
reusable high confidence
None
client nginx application action query
// https://github.com/gmalette/Confoo2016 public function handle($request, Closure $next) { \Log::info( sprintf(
"\n\n[Request] Started to %s routed to %s", $request->path(), $request->route()->getAction()['controller'] ) ); $before = microtime(true); $response = $next($request); $after = microtime(true); \Log::info( sprintf( "[Request] Responded %d in %dms", $response->status(), ($after - $before) * 1000 ) ); return $response; }
// https://github.com/gmalette/Confoo2016 public function handle($request, Closure $next) { \Log::info( sprintf(
"\n\n[Request] Started to %s routed to %s", $request->path(), $request->route()->getAction()['controller'] ) ); $before = microtime(true); $response = $next($request); $after = microtime(true); \Log::info( sprintf( "[Request] Responded %d in %dms", $response->status(), ($after - $before) * 1000 ) ); return $response; }
[Request] Started to / routed to \PostsController@getIndex ... [Request] Responded
200 in 330ms
identify
New Relic Datadog
None
change
benchmark
benchmark identify change
questions?
database
None
logs
orm logs
[SQL] select * from `users` where `users`.`id` = 7842 limit
1 (0.63 ms) [SQL] select * from `tags` where `tags`.`post_id` = 30 and `tags`.`post_id` is not null (0.6 ms)
None
n+1 queries
posts = Post.all posts.each do |post| puts post.author.email end
posts = Post.all posts.each do |post| puts post.author.email end
posts = Post.includes(:author).all posts.each do |post| puts post.author.email end
None
slow query logs
# Time: 2016-02-20T17:09:43.618399Z # User@Host: homestead[homestead] @ [172.16.225.2] Id: 2465
# Query_time: 1.151 Lock_time: 0.00013 Rows_sent: 50 Rows_examined: 500000 select * from `tags` where `tags`.`post_id` in ( '1', '2', '3', '4', '5', '6', '7', '8', '9', '10' );
# Time: 2016-02-20T17:09:43.618399Z # User@Host: homestead[homestead] @ [172.16.225.2] Id: 2465
# Query_time: 1.151 Lock_time: 0.00013 Rows_sent: 50 Rows_examined: 500000 select * from `tags` where `tags`.`post_id` in ( '1', '2', '3', '4', '5', '6', '7', '8', '9', '10' );
# Time: 2016-02-20T17:09:43.618399Z # User@Host: homestead[homestead] @ [172.16.225.2] Id: 2465
# Query_time: 1.151 Lock_time: 0.00013 Rows_sent: 50 Rows_examined: 500000 select * from `tags` where `tags`.`post_id` in ( '1', '2', '3', '4', '5', '6', '7', '8', '9', '10' );
# Time: 2016-02-20T17:09:43.618399Z # User@Host: homestead[homestead] @ [172.16.225.2] Id: 2465
# Query_time: 1.151 Lock_time: 0.00013 Rows_sent: 50 Rows_examined: 500000 select * from `tags` where `tags`.`post_id` in ( '1', '2', '3', '4', '5', '6', '7', '8', '9', '10' ); /*application:Shopify,controller:orders,request_id:bc12813bce*/ basecamp/marginalia
None
api
background
analytics emails uploads
preload
cache
None
cpu
software profilers
flamegraph stackprof xhprof
wall cpu memory
������������������� ��������������������� ������������������������������� ����������������������������� ������������ ������������������ ����� ����������������������������� ������������ �����������������
����� ������������������������������������������ �������� ���������������� ��������������������������������������� �������� ��������������� ���� ����������������������������������������������� �������� ��������������� ���� �������������������������������������� �������� ���������������� ��������������������������������������������� �������� ��������������� ���� ���������������������������������������������������� �������� ��������������� ���� ���������������������������������������������� �������� ��������������� �������������������������������������������� �������� ��������������� ���� ������������������������� �������� ��������������� ��������������������������� �������� ��������������� ���� ��������������������������� �������� ��������������� ���� ������������������������ �������� ��������������� ���� �������������������������� �������� ��������������� ���� ���������������������������� �������� ��������������� ����������������������������������� �������� ��������������� ���� ��������������������������������� �������� ��������������� ���� ���� �������������������������������������� �������� ��������������� ���� ����������������������������������� �������� ��������������� ���� ������������������������ �������� ��������������� ���� ������������������������������ �������� ��������������� ���� ������������������������� �������� ��������������� ���� ������������������ �������� ��������������� ���� ����������������������������������������������������������� �������� ��������������� ���� ��������������� �������� ��������������� ���� ��������������������������� �������� ��������������� ���� ������������������ �������� ��������������� ���� ����������������������� �������� ��������������� ���� ������������������������� �������� ��������������� ���� ������������������ �������� ��������������� ���� ���� ����������������������������� �������� ��������������� ����������������������������� �������� ��������������� ���� ��������������������������� �������� ��������������� ���� ������������������������������������ �������� ��������������� ���� ���� ������������������������������ �������� ��������������� ���� ������������������������������������������ �������� ��������������� ���� ���� ����������������������������������������������������������� �������� ��������������� ���� ���� ����������������������������������� �������� ��������������� �������������������������� �������� ��������������� ���� ����������������������������� �������� ��������������� ���� ���������������������������� �������� ��������������� �������������������������������� �������� ��������������� ���� ���� ���� ��������������������������������� �������� ��������������� ���� ��������������� �������� ��������������� ���� ��������������� �������� ��������������� �������������������������������������� �������� ��������������� ���� ������������������������� �������� ��������������� ���� ���� ������������������������������������� �������� ��������������� ���������������������������������������������� �������� ��������������� ���� ���� ��������������������������������������������������� �������� ��������������� ���� ������������������������������������������������������ �������� ��������������� ���� �������������������������������������������������������� �������� ������������ �� ������������������������������������������������������������������� �������� ��������������� ���� �������������������������������� �������� ��������������� ����������������������������� �������� ��������������� ���� �������������������������������� �������� ��������������� �������������������������������������������������������� �������� ��������������� ���� ����������������������������������������� �������� ��������������� ���� ���������������������������������������������������� �������� ��������������� ���������������������������������������������� �������� ��������������� ���� ���������������������������������������������� �������� ��������������� ���� ��������������������������������������� �������� ��������������� ���� ���� ���� ������������������������������������������������ �������� ��������������� ������������������������������������� �������� ��������������� ���� ������������������������������������� �������� ��������������� ���� ���������������������������������������������� �������� ��������������� ���� ���� ���� ��������������������������������������������������������� �������� ��������������� ��������������������������������������� �������� ��������������� ���� �������������������������������������������� �������� ��������������� ���� ���� ����������������������������������������������������� �������� ��������������� ������������������������������������������ �������� ��������������� ���� �������������������������������������������� �������� ��������������� ������������������������ �������� ��������������� ���� ������������������������������������������� �������� ��������������� ���� ���� ��������������������������������������� �������� ��������������� ���� ���� ���� ���� ���� ���� ���� ���� ���� �������������������������������������������� �������� ������������ ������������������������������������������������������������������ �������� ������������ �� ������������������������������������������� �������� ������������ ����������������������������������� �������� ������������ �� ��������������������������������������� �������� ������������ �� �� �� ��������������������������������������������� �������� ������������
None
benchmark identify change
questions?
thank you! Guillaume Malette gmalette ! "