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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
93
Other Decks in Programming
See All in Programming
技術記事、 専門家としてのプログラマ、 言語化
mizchi
13
6.6k
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
8.4k
LaravelLive Japan の裏方のすべて — 第188回 PHP勉強会@東京 (2026-06-24)
suguruooki
2
130
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
400
はてなアカウント基盤 State of the Union
cockscomb
1
900
Contextとはなにか
chiroruxx
1
380
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
210
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
1
470
Vite+ Unified Toolchain for the Web
naokihaba
0
360
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
350k
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
220
Webフレームワークの ベンチマークについて
yusukebe
0
180
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
Mobile First: as difficult as doing things right
swwweet
225
10k
Believing is Seeing
oripsolob
1
150
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
62
44k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.2k
Documentation Writing (for coders)
carmenintech
77
5.4k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
72
40k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.5k
Why Our Code Smells
bkeepers
PRO
340
58k
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 ! "