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
決定論的オーケストレーションの設計と実装 / Design and Implementation of Deterministic Orchestration
nrslib
4
1.4k
OSもどきOS
arkw
0
580
Vite+ Unified Toolchain for the Web
naokihaba
0
320
New "Type" system on PicoRuby
pocke
1
980
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
210
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
890
Lessons from Spec-Driven Development
simas
PRO
0
210
A2UI という光を覗いてみる
satohjohn
1
140
RTSPクライアントを自作してみた話
simotin13
0
620
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
5.3k
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
310
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.7k
Featured
See All Featured
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
430
Visualization
eitanlees
152
17k
Everyday Curiosity
cassininazir
0
230
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
200
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.3k
WCS-LA-2024
lcolladotor
0
650
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.5k
How to Talk to Developers About Accessibility
jct
2
240
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
170
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
390
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 ! "