Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
Fast Rails (Beta)
Winston
January 27, 2015
Programming
0
43
Fast Rails (Beta)
This is a work-in-progress talk, subject to changes.
First given at RubySG's meetup on 27 Jan, 2015.
Winston
January 27, 2015
Tweet
Share
More Decks by Winston
See All by Winston
winston
1
84
winston
0
120
winston
0
130
winston
0
190
winston
3
580
winston
4
720
winston
3
200
winston
1
62
winston
2
130
Other Decks in Programming
See All in Programming
asumikan
0
280
nbkouhou
0
770
akatsukinewgrad
0
140
yosuke_furukawa
PRO
13
3.6k
atskimura
0
290
osyo
1
360
akatsukinewgrad
0
130
anchorcable
1
120
takaram
1
1.1k
decoc
1
320
adoranwodo
0
210
kubode
0
180
Featured
See All Featured
jacobian
255
20k
roundedbygravity
241
21k
eitanlees
111
9.9k
orderedlist
PRO
329
35k
morganepeng
17
1.1k
jlugia
216
16k
bkeepers
321
53k
davidbonilla
69
3.5k
malarkey
119
16k
rocio
155
11k
pedronauck
652
110k
trishagee
20
2k
Transcript
Fast Rails (Beta)
Frontend Backend Database
This slide intentionally left blank.
Front End
PageSpeed! https://developers.google.com/speed ! YSlow! http://yslow.org/
Asset Pipeline! Far Future Expires Minify JavaScript + CSS Minimize
HTTP Requests Multiple Asset Hosts (http://api.rubyonrails.org/classes/ActionView/Helpers/AssetUrlHelper.html)
Compression! http://nginx.org/en/docs/http/ngx_http_gzip_module.html https://github.com/romanbsd/heroku-deflater
CDN! Static Assets Dynamic Content
Browser Caching! `expires_in`, `expires_now`, `fresh_when`, `stale?` (http://api.rubyonrails.org/classes/ActionController/ConditionalGet.html)
Assets Loading! Stylesheets at the Top JavaScripts at the Bottom
(async)
Images! `gem install smusher` Lazy Load
FOUT! (Flash of Unstyled Text) https://github.com/typekit/webfontloader
Turbolinks! mmmm…
Backend
Update! Ruby 2.2.0 Rails 4.2
Memory! Server Database
Background Jobs! Email/Image Processing
Data Storage! Save to S3? Delete from S3?
Caching! Russian Doll Caching Low-Level Caching
Views! helpers (inline) > partials > loop `render ‘article’, collection:
@articles`
Fast Ruby! https://github.com/JuanitoFatas/fast-ruby
Fast Code! `exists` vs. `present?` Loop in Code vs. SQL
Development! `spring`, `guard`
Database
ActiveRecord! Foreign Keys, Composite Keys, SQL Explain `find`/`find_by`/`find_by_` vs. `where(..).take`
Indexes! Foreign Keys, Composite Keys, SQL Explain https://github.com/eladmeidar/rails_indexes
n+1! `gem install bullet`
The End (Beta)