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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
44
Simplifying Controllers - Confoo 2015
gmalette
1
92
Migrating to Single Table Inheritance
gmalette
1
93
Other Decks in Programming
See All in Programming
Snowflake Summitでの新機能 CoCo / CoWork / snowflake-summit-2026-overall-what-new-coco
tatsuhiro
1
160
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
580
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
200
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
290
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
550
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
1
270
Performance Engineering for Everyone
elenatanasoiu
0
190
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
370
New "Type" system on PicoRuby
pocke
1
980
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
250
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
410
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
720
Featured
See All Featured
Crafting Experiences
bethany
1
180
Unsuck your backbone
ammeep
672
58k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
270
Optimizing for Happiness
mojombo
378
71k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
170
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
62
44k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Abbi's Birthday
coloredviolet
2
8.1k
Code Review Best Practice
trishagee
74
20k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
150
Prompt Engineering for Job Search
mfonobong
0
350
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 ! "