#Red Dot Ruby Conf 2012
##Day 1 Summary of Reddot Ruby Conf 2012
###Google: Ilya Grigorik - Building a Faster Web
####Learned a lot of metrics from Google's Ilya Grigorik:
-
Average page size back in Nov 2010: 700KB
-
Average page size today: 1042KB (does that mean pretty much most of the web sites today are unusable for people with slow connections?)
-
84 requests on average per page!
-
try not to use cookies as much as possible
-
page load battle!
- Straits Times vs Guardian
- Battlefield: Tokyo, using IE8
- Straits:
- @11-@25 seconds: nothing happens
- @25 seconds: ads appear
- @25.1 seconds: images appear
- @25.9 seconds: ads replace image!
-
Blue Line in chrome's web inspector: DOMContentLoaded fires (when parsing is complete)
-
Red Line in chrome's web inspector: Page load (onload)
-
CSS on top(in ), JS at bottom(before end of )
-
async vs defer
- regular: wait for network, execurte, proceed
- defer: download in bg, execute in order after onload
- async: download in bg, execute when ready
-
60% of weight of page are images (on average)
- average 53 images on a page
===========
-
Config:
-
use .env file + foreman
-
Procfile (for awetest?)
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb worker: bundle exec rake jobs:work
-
-
Development vs Production
- dev as close to prod as possible
- use real/consistent data
- heroku db:pull
- rake tasks per feature, and one master rake feature to create production type data for app
- for moving to a different machine and setting up the db
- always specify versions for bundler
-
Not in 12 Factor but recommended: README.md
- brew install memcache (instructions for external dependencies)
-
Staging Environment
- should also have prod data
-
1 app 1 codebase
- Branches (keep codebase clean)
- Git Flow!
-
Logging
- heroku logs -- remote production -- tail
- error pages, if user is admin, ACTUALLY SHOW ERROR BACKTRACE (for awetest)
-
Scale Out
- Workers
- Rails 4: Active queue
- Resque, delayedjob, sidekiq
- Workers
===========
- implicit distriution of information
- share everything
===========
- http://rubydramas.com
- solutions:
- respect each other
- always have readme files
- good documentation
- have some examples
- use github pages/jekyll
- github issue labels for novice, intermediate, advanced
- send pull requests
===========
- http://github.com/sausheong/muse
- compose music algorithmically from muse
- grab a tweet from twitter, etc
- EPIC!
===========
- modular approach to building css
- reuse of css styles
- put all css styles in one page
- like bootstrap
- cactus - gem to test css w/ js
- assert css styles
- Cactus.expect ("header", "width").toEqual("800px")
- has rspec and capybara capabilities
- assert css styles
===========
- Language changes:
- current dir is no longer in load path (require_relative)
- instance_exec = instance_eval with args
- arity checking on lambda
- blocks can accept block args
- new lambda, hash syntax
- GC & Obj allocation changes
- has native VM threads
===========
- client templates
- infra
- dynamic pages can be expensive
- Why need a template engine
- smaller stack
- try ember rails
- campjs.com
===========
Hi there,
Thanks for sharing these! Would you be interested in contributing them to our conferences wiki?
https://github.com/newhavenrb/conferences/wiki
I might have done it myself, but I wanted to make sure you'd be okay with the reuse.
Ben