RailsConf 2011 Keynote

Preview:

DESCRIPTION

this is my keynote for railsconf.

Citation preview

Before I Begin...

Wednesday, May 18, 2011

@jonleighton

♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥

♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥ ♥Wednesday, May 18, 2011

Wednesday, May 18, 2011

♥Wednesday, May 18, 2011

Wednesday, May 18, 2011

I ♥ José

Wednesday, May 18, 2011

Double Dream Hands:SO INTENSE

Wednesday, May 18, 2011

ZOMG!!!Wednesday, May 18, 2011

HAPPYWednesday, May 18, 2011

RAILSWednesday, May 18, 2011

CONFWednesday, May 18, 2011

♥ ♥ ♥ ♥Wednesday, May 18, 2011

Aaron Patterson

Wednesday, May 18, 2011

@tenderlove

Wednesday, May 18, 2011

AT&T, AT&T logo and all AT&T related marks are trademarks of AT&T Intellectual Property and/or AT&T affiliated companies.Wednesday, May 18, 2011

WWFMD?Wednesday, May 18, 2011

Richard GabrielResearcher

Guy SteeleSoftware Architect

DHHPartner

Wednesday, May 18, 2011

Aaron BatalionCTO

Chad DickersonCTO

Dan MeltonCTO

Wednesday, May 18, 2011

Corey HainesCorey Haines

Eric RiesVenture Advisor

Aaron PattersonSeñor Software

Engineer

Wednesday, May 18, 2011

Wednesday, May 18, 2011

LOLWUT

Wednesday, May 18, 2011

Señor Software EngineerWednesday, May 18, 2011

Señor Software EngineerWednesday, May 18, 2011

Wednesday, May 18, 2011

Wednesday, May 18, 2011

Agenda

Wednesday, May 18, 2011

New Features

Agenda

Development Pro Tips™

Real Talk!

Wednesday, May 18, 2011

I will be veryTECHNICAL

Implementation and thoughts on API design

Wednesday, May 18, 2011

I will be veryCRITICAL

Because my audience is smart

Because I care

Wednesday, May 18, 2011

New Features!

Wednesday, May 18, 2011

git log --since="1 year ago"

Wednesday, May 18, 2011

API Strategy

Wednesday, May 18, 2011

rails generate VC

Wednesday, May 18, 2011

def halts?(function)

Wednesday, May 18, 2011

Prepared Statements

Wednesday, May 18, 2011

select * from 'users' where id = 10

Wednesday, May 18, 2011

select * from 'users' where id = ?

Wednesday, May 18, 2011

DATABASE

RAILS APPWednesday, May 18, 2011

DATABASE

RAILS APP

Records

Wednesday, May 18, 2011

4 Steps!

Wednesday, May 18, 2011

DATABASE

RAILS APPWednesday, May 18, 2011

DATABASE

RAILS APP

Token

Wednesday, May 18, 2011

DATABASE

RAILS APPWednesday, May 18, 2011

DATABASE

RAILS APP

Records

Wednesday, May 18, 2011

4 Steps!

Wednesday, May 18, 2011

2 Steps!

Wednesday, May 18, 2011

Impact

Wednesday, May 18, 2011

SQLite3

Wednesday, May 18, 2011

0.00

0.00

0.01

0.10

1.00

10.00

100.00

10 100 1000 10000 100000

y = 0.0002e2.187x

y = 8.556E-5e2.2868x

SQLite3 Simple Prepared Statement

Number of QueriesCached Trend 1Non-Cached Trend 2

Wednesday, May 18, 2011

8665 q/s12987 q/s

Wednesday, May 18, 2011

Δ 4322 q/s

Wednesday, May 18, 2011

0

0

0

1

10

100

1000

10 100 1000 10000 100000

y = 0.0029e2.3111xy = 0.0003e2.2227x

SQLite3 Complex SQL Statement

Number of QueriesCached Trend 1Non-Cached Trend 2

Wednesday, May 18, 2011

339 q/s4184 q/s

Wednesday, May 18, 2011

Δ 3845 q/s

Wednesday, May 18, 2011

PostgreSQL

Wednesday, May 18, 2011

0.0

0.0

0.1

1.0

10.0

100.0

10 100 1000 10000 100000

y = 0.0004e2.1424xy = 0.0002e2.3018x

PostgreSQL Simple Query

QueriesCached Trend 1No Cache Trend 2

Wednesday, May 18, 2011

4662 q/s5586 q/s

Wednesday, May 18, 2011

Δ 924 q/s

Wednesday, May 18, 2011

0

0

0

1

10

100

1000

10 100 1000 10000 100000

y = 0.0047e2.2153x

y = 0.0005e2.173x

PostgreSQL Complex Query

QueriesCached Trend 1No Cache Trend 2

Wednesday, May 18, 2011

307 q/s3322 q/s

Wednesday, May 18, 2011

Δ 3015 q/s

Wednesday, May 18, 2011

MySQL

Wednesday, May 18, 2011

0

0

0

1

10

100

10 100 1000 10000 100000

MySQL Simple Query

QueriesCache No Cache

Wednesday, May 18, 2011

6410 q/s5154 q/s

Wednesday, May 18, 2011

Δ -1256 q/s

Wednesday, May 18, 2011

0

0

0

1

10

100

1000

10 100 1000 10000 100000

MySQL Complex SQL Query

Category TitleCachedNo Cache

Wednesday, May 18, 2011

626 q/s1198 q/s

Wednesday, May 18, 2011

Δ 572 q/s

Wednesday, May 18, 2011

No Query Planning

Wednesday, May 18, 2011

Two Network Roundtrips

Wednesday, May 18, 2011

Problem?Wednesday, May 18, 2011

Problem?Wednesday, May 18, 2011

[[#<Mysql::Time:2011-05-13 22:03:55>]]

[["2011-05-13 22:03:55"]]

select updated_at from pirates

Wednesday, May 18, 2011

[[#<Mysql::Time:2011-05-13 22:03:55>]]

[["2011-05-13 22:03:55"]]

select updated_at from pirates

Prepared Statement

Wednesday, May 18, 2011

[[#<Mysql::Time:2011-05-13 22:03:55>]]

[["2011-05-13 22:03:55"]]

select updated_at from pirates

Regular Statement

Wednesday, May 18, 2011

API Changes

Wednesday, May 18, 2011

User.find 1

Wednesday, May 18, 2011

User.find 1

Wednesday, May 18, 2011

SerializedAttributes

Wednesday, May 18, 2011

class User < ActiveRecord::Base serialize :preferencesend

Wednesday, May 18, 2011

user = User.find 1user.preferences = { :hello => 'world!' }user.save!

Saves as YAML

Wednesday, May 18, 2011

Why YAML?

Wednesday, May 18, 2011

class User < ActiveRecord::Base serialize :preferences, Base64Encoder.newend

Wednesday, May 18, 2011

class Base64Encoder def load(value) return unless value value.unpack('m').last end

def dump(text) [text].pack('m') endend

Base 64 Storage

Wednesday, May 18, 2011

class JSONEncoder def load(value) return unless value JSON.load value end

def dump(text) JSON.dump(text) endend

JSON Storage

Wednesday, May 18, 2011

class MarshalEncoder def load(value) return unless value Marshal.load value end

def dump(text) Marshal.dump(text) endend

Marshal Storage

Wednesday, May 18, 2011

class XMLEncoder def load(value) return unless value Nokogiri.XML value end

def dump(doc) doc.to_xml endend

XML Storage

Wednesday, May 18, 2011

Official NoSQL Support

Wednesday, May 18, 2011

Official NoSQL Support

IT'SOFFICIAL!

Wednesday, May 18, 2011

Wednesday, May 18, 2011

2 Caveats

Wednesday, May 18, 2011

PostgreSQL Only

Wednesday, May 18, 2011

You might hurt yourself

Wednesday, May 18, 2011

Wednesday, May 18, 2011

DO NOT DO THISclass User < ActiveRecord::Base class HStore def load value return unless value eval "{#{value}}" end

def dump value return unless value value.map { |xs| xs.join '=>' }.join ', ' end end

serialize :preferences, HStore.newend

Wednesday, May 18, 2011

class BCryptCoder def load(value) return unless value BCrypt::Password.new value end

def dump(value) BCrypt::Password.create(value).to_s endend

BCrypt Coder

Wednesday, May 18, 2011

BCrypt Serialization

class User < ActiveRecord::Base serialize :crazy_column, BCryptCoder.newend

Wednesday, May 18, 2011

Dumping Loading

YAML dump load

JSON dump load

Marshal dump load

stdlib serialization API

Wednesday, May 18, 2011

YOU choose

Storage type

Column name

Wednesday, May 18, 2011

Good Abstractionsyield

Good Features

Wednesday, May 18, 2011

CONSISTENCYis FREEDOM

and FLEXIBILITY

Wednesday, May 18, 2011

has_secure_password

Wednesday, May 18, 2011

class User < ActiveRecord::Base has_secure_passwordend

SECURITY!

Wednesday, May 18, 2011

SECURITY!

user = User.find 1user.password = 'lolwut'user.save!

Wednesday, May 18, 2011

♥ Introduces a new method

♥ Saves password in `password_digest`

♥ Uses BCrypt

Advantages

Wednesday, May 18, 2011

♥ Introduces a new method

♥ Saves password in `password_digest`

♥ Uses BCrypt

DisadvantagesAPI is not flexible

Not reusable

Wednesday, May 18, 2011

GO GREEN!

Wednesday, May 18, 2011

Write SomethingREUSABLE!

Wednesday, May 18, 2011

StreamingResponses

response streaming

chunked encoding

Wednesday, May 18, 2011

Rack API

class MyApp def call(env) [200, { 'X-ZOMG' => 'hi' }, ['web page!']] endend

Wednesday, May 18, 2011

Rails 3.0.x

class PoniesController def call(env) body << render(:content) body << render(:layout)

[200, {}, body] endend

Wednesday, May 18, 2011

DelayedEvaluation

Wednesday, May 18, 2011

Body#each

Wednesday, May 18, 2011

Rails 3.1.xclass DelayedBody def each yield render(:layout) yield render(:content) endend

class PoniesController def call(env) [200, {}, DelayedBody.new] endend

Wednesday, May 18, 2011

Middleware

Wednesday, May 18, 2011

Middleware☹Wednesday, May 18, 2011

Request Timer

Middleware Chain

Connection Manager

Application

Just consider connection manager and application

Wednesday, May 18, 2011

Middleware Chain

Connection Manager

Application

Wednesday, May 18, 2011

Middleware Chain

Connection Manager

Application

call(env)

call(env)

Wednesday, May 18, 2011

Middleware Chain

Connection Manager

Application

[200, {}, body]

[200, {}, body]

Wednesday, May 18, 2011

Connection Manager

When ERb is evaluated,db connection does notexist

Wednesday, May 18, 2011

Connection Manager

Open DB Connection When ERb is evaluated,db connection does notexist

Wednesday, May 18, 2011

Connection Manager

Open DB Connection

Delegate

When ERb is evaluated,db connection does notexist

Wednesday, May 18, 2011

Connection Manager

Open DB Connection

Delegate

Close DB Connection

When ERb is evaluated,db connection does notexist

Wednesday, May 18, 2011

Connection Manager

Open DB Connection

Delegate

Close DB Connection

Return Delegate Values

When ERb is evaluated,db connection does notexist

Wednesday, May 18, 2011

Problem?Wednesday, May 18, 2011

Problem?Wednesday, May 18, 2011

Body#close

Wednesday, May 18, 2011

Body Proxy

class ConnectionBodyProxy def initialize(delegate) @delegate = delegate end def each(&blk) @delegate.each(&blk) end def close # CLOSE CONNECTION endend

Wednesday, May 18, 2011

Connection Manager

class ConnectionManager def initialize(app); @app = app; end

def call(env) # OPEN CONNECTION response = @app.call(env) response[2] = ConnectionBodyProxy.new(response[2]) response endend

Wednesday, May 18, 2011

Wednesday, May 18, 2011

Wednesday, May 18, 2011

Wednesday, May 18, 2011

~25 middleware

Wednesday, May 18, 2011

Embrace Diversity

Wednesday, May 18, 2011

Types of Middleware

♥ Generators (our application)

♥ Filters (gzip, etc)

♥ Lifecycle Handlers (connection management)

Wednesday, May 18, 2011

Real Talk!

Wednesday, May 18, 2011

Rails is getting slower

Wednesday, May 18, 2011

Time for N Requests

0.01

0.1

1

10

100

10 100 1000 10000

Requests

Rails 2.3 Rails 3.0

Wednesday, May 18, 2011

Avg Requests / time

50

162.5

275

387.5

500

10 100 1000 10000

Requests

Rails 2.3 Rails 3.0

Wednesday, May 18, 2011

MiddlewareIncreased

Wednesday, May 18, 2011

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/rubyTotal samples: 740Focusing on: 740Dropped nodes with <= 3 abs(samples)Dropped edges with <= 0 samples

RackRuntime#call

0 (0.0%)of 463 (62.6%)

RailsRack

Logger#call0 (0.0%)

of 463 (62.6%)

463

ActionDispatchShowExceptions#call

0 (0.0%)of 381 (51.5%)

381

RailsRack

Logger#after_dispatch0 (0.0%)

of 80 (10.8%)

80

#<Class:0x102625d88>#call0 (0.0%)

of 462 (62.4%)

462

Mutex#synchronize1 (0.1%)

of 462 (62.4%)

RackLock#call

0 (0.0%)of 462 (62.4%)

462

ActiveSupportBufferedLogger#flush

77 (10.4%)of 78 (10.5%)

77

462

462

RailsApplication#call

0 (0.0%)of 462 (62.4%)

462

Integer#times0 (0.0%)

of 461 (62.3%)

461

ActionDispatchCallbacks#call

2 (0.3%)of 383 (51.8%)

ActionDispatchCallbacks#_run_call_callbacks

0 (0.0%)of 381 (51.5%)

381

ActiveRecordConnectionAdapters

ConnectionManagement#call0 (0.0%)

of 381 (51.5%)

381

RackSendfile#call

0 (0.0%)of 383 (51.8%)

383

ActionDispatchRemoteIp#call

0 (0.0%)of 382 (51.6%)

382

381

381

ActiveRecordQueryCache#call

2 (0.3%)of 377 (50.9%)

375

Class#cache0 (0.0%)

of 376 (50.8%)

375

ActionDispatchCookies#call

4 (0.5%)of 372 (50.3%)

372

Object#cache0 (0.0%)

of 373 (50.4%)

373

373

ActionDispatchSession

AbstractStore#call1 (0.1%)

of 367 (49.6%)

367

ActionDispatchFlash#call

0 (0.0%)of 365 (49.3%)

365

ActionDispatchParamsParser#call

0 (0.0%)of 360 (48.6%)

360

ActionDispatchHead#call

1 (0.1%)of 360 (48.6%)

ActionDispatchBestStandardsSupport#call

2 (0.3%)of 359 (48.5%)

359

RackMethodOverride#call

0 (0.0%)of 360 (48.6%)

360

360

ActionDispatchRouting

RouteSet#call0 (0.0%)

of 357 (48.2%)

357

RackMount

RouteSet#call0 (0.0%)

of 357 (48.2%)

357

RackMount

RouteSet#recognize1 (0.1%)

of 357 (48.2%)

357

ActionDispatchRoutingRouteSet

Dispatcher#call0 (0.0%)

of 355 (48.0%)

355 355

Array#optimized_each1 (0.1%)

of 356 (48.1%)

356 355

ActionDispatchRoutingRouteSet

Dispatcher#dispatch1 (0.1%)

of 355 (48.0%)

355

PostsController.action3 (0.4%)

of 354 (47.8%)

354

ActionControllerMetal#dispatch

0 (0.0%)of 350 (47.3%)

350

346

ActionControllerMetal#process

0 (0.0%)of 339 (45.8%)

339

AbstractControllerBase#process

0 (0.0%)of 338 (45.7%)

338

ActionControllerMetal#process_action

3 (0.4%)of 337 (45.5%)

337

956

ActiveSupportNotifications.instrument

0 (0.0%)of 322 (43.5%)

322

ActionControllerMetal#run_callbacks

1 (0.1%)of 311 (42.0%)

311

AbstractControllerBase#process_action

0 (0.0%)of 305 (41.2%)

305

Symbol#to_proc4 (0.5%)

of 82 (11.1%)

2

312

ActiveSupportNotifications

Instrumenter#instrument0 (0.0%)

of 322 (43.5%)

507

Object#_render_template2 (0.3%)

of 189 (25.5%)

175

ActionViewTemplate#render

2 (0.3%)of 167 (22.6%)

167

487

ApplicationController#_run_process_action_callbacks0 (0.0%)

of 310 (41.9%)

310

PostsController#_run__84203013__process_action__199225275__callbacks0 (0.0%)

of 310 (41.9%)

310

307

ActionControllerMetal#send_action

0 (0.0%)of 305 (41.2%)

305

Object#send_action0 (0.0%)

of 305 (41.2%)

305

PostsController#index2 (0.3%)

of 305 (41.2%)

305

ActionControllerMetal#respond_to

0 (0.0%)of 239 (32.3%)

239

Post.all0 (0.0%)

of 66 (8.9%)

66

ActionControllerMetal#retrieve_response_from_mimes

5 (0.7%)of 239 (32.3%)

239

2

ActionControllerMetal#default_render

0 (0.0%)of 231 (31.2%)

231

ActionControllerMetal#render

1 (0.1%)of 231 (31.2%)

231

438

ActionControllerMetal#cleanup_view_runtime

0 (0.0%)of 230 (31.1%)

230

Benchmark.ms10 (1.4%)

of 230 (31.1%)

230

ActionControllerMetal#render_to_string

0 (0.0%)of 219 (29.6%)

219230

230

219

Benchmark.realtime0 (0.0%)

of 220 (29.7%)

220219

ActionControllerMetal#render_to_body

2 (0.3%)of 213 (28.8%)

213

424

ActionControllerMetal#_render_template

0 (0.0%)of 210 (28.4%)

210

Object#render0 (0.0%)

of 190 (25.7%)

190

189185

18

Object#_render_layout6 (0.8%)

of 155 (20.9%)

155

167

Object#_app_views_layouts_application_html_erb___604422253_2164033400_00 (0.0%)

of 148 (20.0%)

148

149

1

Object#stylesheet_link_tag0 (0.0%)

of 85 (11.5%)

85

Object#javascript_include_tag3 (0.4%)

of 58 (7.8%)

58

garbage_collector146 (19.7%)

Object#require27 (3.6%)

of 128 (17.3%)165

Kernel#require28 (3.8%)

of 63 (8.5%)

118

Rails30Application.method_missing

0 (0.0%)of 62 (8.4%)

62

Object#expand_stylesheet_sources0 (0.0%)

of 83 (11.2%)

83

Object#collect_asset_files81 (10.9%)

81

78

ActiveSupportLogSubscriber.flush_all!

0 (0.0%)of 80 (10.8%)

80

80

78

Object#all0 (0.0%)

of 62 (8.4%)

62

74

60

ActiveRecordRelation#to_a

1 (0.1%)of 62 (8.4%)

Post.find_by_sql0 (0.0%)

of 57 (7.7%)

57

62

Object#run_initializers0 (0.0%)

of 62 (8.4%)60

RailsInitializable

Initializer#run0 (0.0%)

of 60 (8.1%)

60

RailsApplication#initialize!

0 (0.0%)of 62 (8.4%)

62

62

Object#instance_exec2 (0.3%)

of 60 (8.1%)

17

60

Object#map0 (0.0%)

of 57 (7.7%)

ActiveRecordConnectionAdapters

SQLiteAdapter#execute1 (0.1%)

of 56 (7.6%)

Wednesday, May 18, 2011

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/rubyTotal samples: 740Focusing on: 740Dropped nodes with <= 3 abs(samples)Dropped edges with <= 0 samples

RackRuntime#call

0 (0.0%)of 463 (62.6%)

RailsRack

Logger#call0 (0.0%)

of 463 (62.6%)

463

ActionDispatchShowExceptions#call

0 (0.0%)of 381 (51.5%)

381

RailsRack

Logger#after_dispatch0 (0.0%)

of 80 (10.8%)

80

#<Class:0x102625d88>#call0 (0.0%)

of 462 (62.4%)

462

Mutex#synchronize1 (0.1%)

of 462 (62.4%)

RackLock#call

0 (0.0%)of 462 (62.4%)

462

ActiveSupportBufferedLogger#flush

77 (10.4%)of 78 (10.5%)

77

462

462

RailsApplication#call

0 (0.0%)of 462 (62.4%)

462

Integer#times0 (0.0%)

of 461 (62.3%)

461

ActionDispatchCallbacks#call

2 (0.3%)of 383 (51.8%)

ActionDispatchCallbacks#_run_call_callbacks

0 (0.0%)of 381 (51.5%)

381

ActiveRecordConnectionAdapters

ConnectionManagement#call0 (0.0%)

of 381 (51.5%)

381

RackSendfile#call

0 (0.0%)of 383 (51.8%)

383

ActionDispatchRemoteIp#call

0 (0.0%)of 382 (51.6%)

382

381

381

ActiveRecordQueryCache#call

2 (0.3%)of 377 (50.9%)

375

Class#cache0 (0.0%)

of 376 (50.8%)

375

ActionDispatchCookies#call

4 (0.5%)of 372 (50.3%)

372

Object#cache0 (0.0%)

of 373 (50.4%)

373

373

ActionDispatchSession

AbstractStore#call1 (0.1%)

of 367 (49.6%)

367

ActionDispatchFlash#call

0 (0.0%)of 365 (49.3%)

365

ActionDispatchParamsParser#call

0 (0.0%)of 360 (48.6%)

360

ActionDispatchHead#call

1 (0.1%)of 360 (48.6%)

ActionDispatchBestStandardsSupport#call

2 (0.3%)of 359 (48.5%)

359

RackMethodOverride#call

0 (0.0%)of 360 (48.6%)

360

360

ActionDispatchRouting

RouteSet#call0 (0.0%)

of 357 (48.2%)

357

RackMount

RouteSet#call0 (0.0%)

of 357 (48.2%)

357

RackMount

RouteSet#recognize1 (0.1%)

of 357 (48.2%)

357

ActionDispatchRoutingRouteSet

Dispatcher#call0 (0.0%)

of 355 (48.0%)

355 355

Array#optimized_each1 (0.1%)

of 356 (48.1%)

356 355

ActionDispatchRoutingRouteSet

Dispatcher#dispatch1 (0.1%)

of 355 (48.0%)

355

PostsController.action3 (0.4%)

of 354 (47.8%)

354

ActionControllerMetal#dispatch

0 (0.0%)of 350 (47.3%)

350

346

ActionControllerMetal#process

0 (0.0%)of 339 (45.8%)

339

AbstractControllerBase#process

0 (0.0%)of 338 (45.7%)

338

ActionControllerMetal#process_action

3 (0.4%)of 337 (45.5%)

337

956

ActiveSupportNotifications.instrument

0 (0.0%)of 322 (43.5%)

322

ActionControllerMetal#run_callbacks

1 (0.1%)of 311 (42.0%)

311

AbstractControllerBase#process_action

0 (0.0%)of 305 (41.2%)

305

Symbol#to_proc4 (0.5%)

of 82 (11.1%)

2

312

ActiveSupportNotifications

Instrumenter#instrument0 (0.0%)

of 322 (43.5%)

507

Object#_render_template2 (0.3%)

of 189 (25.5%)

175

ActionViewTemplate#render

2 (0.3%)of 167 (22.6%)

167

487

ApplicationController#_run_process_action_callbacks0 (0.0%)

of 310 (41.9%)

310

PostsController#_run__84203013__process_action__199225275__callbacks0 (0.0%)

of 310 (41.9%)

310

307

ActionControllerMetal#send_action

0 (0.0%)of 305 (41.2%)

305

Object#send_action0 (0.0%)

of 305 (41.2%)

305

PostsController#index2 (0.3%)

of 305 (41.2%)

305

ActionControllerMetal#respond_to

0 (0.0%)of 239 (32.3%)

239

Post.all0 (0.0%)

of 66 (8.9%)

66

ActionControllerMetal#retrieve_response_from_mimes

5 (0.7%)of 239 (32.3%)

239

2

ActionControllerMetal#default_render

0 (0.0%)of 231 (31.2%)

231

ActionControllerMetal#render

1 (0.1%)of 231 (31.2%)

231

438

ActionControllerMetal#cleanup_view_runtime

0 (0.0%)of 230 (31.1%)

230

Benchmark.ms10 (1.4%)

of 230 (31.1%)

230

ActionControllerMetal#render_to_string

0 (0.0%)of 219 (29.6%)

219230

230

219

Benchmark.realtime0 (0.0%)

of 220 (29.7%)

220219

ActionControllerMetal#render_to_body

2 (0.3%)of 213 (28.8%)

213

424

ActionControllerMetal#_render_template

0 (0.0%)of 210 (28.4%)

210

Object#render0 (0.0%)

of 190 (25.7%)

190

189185

18

Object#_render_layout6 (0.8%)

of 155 (20.9%)

155

167

Object#_app_views_layouts_application_html_erb___604422253_2164033400_00 (0.0%)

of 148 (20.0%)

148

149

1

Object#stylesheet_link_tag0 (0.0%)

of 85 (11.5%)

85

Object#javascript_include_tag3 (0.4%)

of 58 (7.8%)

58

garbage_collector146 (19.7%)

Object#require27 (3.6%)

of 128 (17.3%)165

Kernel#require28 (3.8%)

of 63 (8.5%)

118

Rails30Application.method_missing

0 (0.0%)of 62 (8.4%)

62

Object#expand_stylesheet_sources0 (0.0%)

of 83 (11.2%)

83

Object#collect_asset_files81 (10.9%)

81

78

ActiveSupportLogSubscriber.flush_all!

0 (0.0%)of 80 (10.8%)

80

80

78

Object#all0 (0.0%)

of 62 (8.4%)

62

74

60

ActiveRecordRelation#to_a

1 (0.1%)of 62 (8.4%)

Post.find_by_sql0 (0.0%)

of 57 (7.7%)

57

62

Object#run_initializers0 (0.0%)

of 62 (8.4%)60

RailsInitializable

Initializer#run0 (0.0%)

of 60 (8.1%)

60

RailsApplication#initialize!

0 (0.0%)of 62 (8.4%)

62

62

Object#instance_exec2 (0.3%)

of 60 (8.1%)

17

60

Object#map0 (0.0%)

of 57 (7.7%)

ActiveRecordConnectionAdapters

SQLiteAdapter#execute1 (0.1%)

of 56 (7.6%)

Wednesday, May 18, 2011

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/rubyTotal samples: 740Focusing on: 740Dropped nodes with <= 3 abs(samples)Dropped edges with <= 0 samples

RackRuntime#call

0 (0.0%)of 463 (62.6%)

RailsRack

Logger#call0 (0.0%)

of 463 (62.6%)

463

ActionDispatchShowExceptions#call

0 (0.0%)of 381 (51.5%)

381

RailsRack

Logger#after_dispatch0 (0.0%)

of 80 (10.8%)

80

#<Class:0x102625d88>#call0 (0.0%)

of 462 (62.4%)

462

Mutex#synchronize1 (0.1%)

of 462 (62.4%)

RackLock#call

0 (0.0%)of 462 (62.4%)

462

ActiveSupportBufferedLogger#flush

77 (10.4%)of 78 (10.5%)

77

462

462

RailsApplication#call

0 (0.0%)of 462 (62.4%)

462

Integer#times0 (0.0%)

of 461 (62.3%)

461

ActionDispatchCallbacks#call

2 (0.3%)of 383 (51.8%)

ActionDispatchCallbacks#_run_call_callbacks

0 (0.0%)of 381 (51.5%)

381

ActiveRecordConnectionAdapters

ConnectionManagement#call0 (0.0%)

of 381 (51.5%)

381

RackSendfile#call

0 (0.0%)of 383 (51.8%)

383

ActionDispatchRemoteIp#call

0 (0.0%)of 382 (51.6%)

382

381

381

ActiveRecordQueryCache#call

2 (0.3%)of 377 (50.9%)

375

Class#cache0 (0.0%)

of 376 (50.8%)

375

ActionDispatchCookies#call

4 (0.5%)of 372 (50.3%)

372

Object#cache0 (0.0%)

of 373 (50.4%)

373

373

ActionDispatchSession

AbstractStore#call1 (0.1%)

of 367 (49.6%)

367

ActionDispatchFlash#call

0 (0.0%)of 365 (49.3%)

365

ActionDispatchParamsParser#call

0 (0.0%)of 360 (48.6%)

360

ActionDispatchHead#call

1 (0.1%)of 360 (48.6%)

ActionDispatchBestStandardsSupport#call

2 (0.3%)of 359 (48.5%)

359

RackMethodOverride#call

0 (0.0%)of 360 (48.6%)

360

360

ActionDispatchRouting

RouteSet#call0 (0.0%)

of 357 (48.2%)

357

RackMount

RouteSet#call0 (0.0%)

of 357 (48.2%)

357

RackMount

RouteSet#recognize1 (0.1%)

of 357 (48.2%)

357

ActionDispatchRouting

RouteSetDispatcher#call

0 (0.0%)of 355 (48.0%)

355 355

Array#optimized_each1 (0.1%)

of 356 (48.1%)

356 355

ActionDispatchRoutingRouteSet

Dispatcher#dispatch1 (0.1%)

of 355 (48.0%)

355

PostsController.action3 (0.4%)

of 354 (47.8%)

354

ActionControllerMetal#dispatch

0 (0.0%)of 350 (47.3%)

350

346

ActionControllerMetal#process

0 (0.0%)of 339 (45.8%)

339

AbstractControllerBase#process

0 (0.0%)of 338 (45.7%)

338

ActionControllerMetal#process_action

3 (0.4%)of 337 (45.5%)

337

956

ActiveSupportNotifications.instrument

0 (0.0%)of 322 (43.5%)

322

ActionControllerMetal#run_callbacks

1 (0.1%)of 311 (42.0%)

311

AbstractControllerBase#process_action

0 (0.0%)of 305 (41.2%)

305

Symbol#to_proc4 (0.5%)

of 82 (11.1%)

2

312

ActiveSupportNotifications

Instrumenter#instrument0 (0.0%)

of 322 (43.5%)

507

Object#_render_template2 (0.3%)

of 189 (25.5%)

175

ActionViewTemplate#render

2 (0.3%)of 167 (22.6%)

167

487

ApplicationController#_run_process_action_callbacks0 (0.0%)

of 310 (41.9%)

310

PostsController#_run__84203013__process_action__199225275__callbacks0 (0.0%)

of 310 (41.9%)

310

307

ActionControllerMetal#send_action

0 (0.0%)of 305 (41.2%)

305

Object#send_action0 (0.0%)

of 305 (41.2%)

305

PostsController#index2 (0.3%)

of 305 (41.2%)

305

ActionControllerMetal#respond_to

0 (0.0%)of 239 (32.3%)

239

Post.all0 (0.0%)

of 66 (8.9%)

66

ActionControllerMetal#retrieve_response_from_mimes

5 (0.7%)of 239 (32.3%)

239

2

ActionControllerMetal#default_render

0 (0.0%)of 231 (31.2%)

231

ActionControllerMetal#render

1 (0.1%)of 231 (31.2%)

231

438

ActionControllerMetal#cleanup_view_runtime

0 (0.0%)of 230 (31.1%)

230

Benchmark.ms10 (1.4%)

of 230 (31.1%)

230

ActionControllerMetal#render_to_string

0 (0.0%)of 219 (29.6%)

219230

230

219

Benchmark.realtime0 (0.0%)

of 220 (29.7%)

220219

ActionControllerMetal#render_to_body

2 (0.3%)of 213 (28.8%)

213

424

ActionControllerMetal#_render_template

0 (0.0%)of 210 (28.4%)

210

Object#render0 (0.0%)

of 190 (25.7%)

190

189185

18

Object#_render_layout6 (0.8%)

of 155 (20.9%)

155

167

Object#_app_views_layouts_application_html_erb___604422253_2164033400_00 (0.0%)

of 148 (20.0%)

148

149

1

Object#stylesheet_link_tag0 (0.0%)

of 85 (11.5%)

85

Object#javascript_include_tag3 (0.4%)

of 58 (7.8%)

58

garbage_collector146 (19.7%)

Object#require27 (3.6%)

of 128 (17.3%)165

Kernel#require28 (3.8%)

of 63 (8.5%)

118

Rails30Application.method_missing

0 (0.0%)of 62 (8.4%)

62

Object#expand_stylesheet_sources0 (0.0%)

of 83 (11.2%)

83

Object#collect_asset_files81 (10.9%)

81

78

ActiveSupportLogSubscriber.flush_all!

0 (0.0%)of 80 (10.8%)

80

80

78

Object#all0 (0.0%)

of 62 (8.4%)

62

74

60

ActiveRecordRelation#to_a

1 (0.1%)of 62 (8.4%)

Post.find_by_sql0 (0.0%)

of 57 (7.7%)

57

62

Object#run_initializers0 (0.0%)

of 62 (8.4%)60

RailsInitializable

Initializer#run0 (0.0%)

of 60 (8.1%)

60

RailsApplication#initialize!

0 (0.0%)of 62 (8.4%)

62

62

Object#instance_exec2 (0.3%)

of 60 (8.1%)

17

60

Object#map0 (0.0%)

of 57 (7.7%)

ActiveRecordConnectionAdapters

SQLiteAdapter#execute1 (0.1%)

of 56 (7.6%)

Wednesday, May 18, 2011

GC Pressure

Wednesday, May 18, 2011

0

17.5

35

52.5

70

Stack Depth

Rails 2.3 Rails 3.0 Rails 3.1

Stack Depth

Wednesday, May 18, 2011

Rails 2.3 Stack

Wednesday, May 18, 2011

51 deep

Wednesday, May 18, 2011

Rails 3.0 Stack

Wednesday, May 18, 2011

60 deep

Wednesday, May 18, 2011

Rails 3.1 Stack

Wednesday, May 18, 2011

67 deep

Wednesday, May 18, 2011

/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/implicit_render.rb:5:in `send_action'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/implicit_render.rb:5:in `send_action'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/abstract_controller/base.rb:150:in `process_action'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/rendering.rb:11:in `process_action'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/abstract_controller/callbacks.rb:18:in `process_action'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:436:in `_run__84203013__process_action__199225275__callbacks'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:410:in `send'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:94:in `send'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:94:in `run_callbacks'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/abstract_controller/callbacks.rb:17:in `process_action'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/instrumentation.rb:30:in `process_action'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/notifications.rb:52:in `instrument'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/notifications/instrumenter.rb:21:in `instrument'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/notifications.rb:52:in `instrument'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/instrumentation.rb:29:in `process_action'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/rescue.rb:17:in `process_action'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/abstract_controller/base.rb:119:in `process'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/abstract_controller/rendering.rb:41:in `process'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_controller/metal.rb:138:in `dispatch'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_controller/metal.rb:178:in `action'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/routing/route_set.rb:62:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/routing/route_set.rb:62:in `dispatch'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/routing/route_set.rb:27:in `call'/Library/Ruby/Gems/1.8/gems/rack-mount-0.6.14/lib/rack/mount/route_set.rb:148:in `call'/Library/Ruby/Gems/1.8/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:93:in `recognize'/Library/Ruby/Gems/1.8/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:68:in `optimized_each'/Library/Ruby/Gems/1.8/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:92:in `recognize'/Library/Ruby/Gems/1.8/gems/rack-mount-0.6.14/lib/rack/mount/route_set.rb:139:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/routing/route_set.rb:493:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/head.rb:14:in `call'/Library/Ruby/Gems/1.8/gems/rack-1.2.2/lib/rack/methodoverride.rb:24:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/params_parser.rb:21:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/flash.rb:182:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/cookies.rb:302:in `call'/Library/Ruby/Gems/1.8/gems/activerecord-3.0.7/lib/active_record/query_cache.rb:32:in `call'/Library/Ruby/Gems/1.8/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'/Library/Ruby/Gems/1.8/gems/activerecord-3.0.7/lib/active_record/query_cache.rb:12:in `cache'/Library/Ruby/Gems/1.8/gems/activerecord-3.0.7/lib/active_record/query_cache.rb:31:in `call'/Library/Ruby/Gems/1.8/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/callbacks.rb:46:in `call'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:416:in `_run_call_callbacks'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/callbacks.rb:44:in `call'/Library/Ruby/Gems/1.8/gems/rack-1.2.2/lib/rack/sendfile.rb:107:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'/Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/rack/logger.rb:13:in `call'/Library/Ruby/Gems/1.8/gems/rack-1.2.2/lib/rack/runtime.rb:17:in `call'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/cache/strategy/local_cache.rb:72:in `call'/Library/Ruby/Gems/1.8/gems/rack-1.2.2/lib/rack/lock.rb:11:in `call'/Library/Ruby/Gems/1.8/gems/rack-1.2.2/lib/rack/lock.rb:11:in `synchronize'/Library/Ruby/Gems/1.8/gems/rack-1.2.2/lib/rack/lock.rb:11:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/static.rb:30:in `call'/Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:168:in `call'fuuu.rb:44fuuu.rb:43:in `times'fuuu.rb:43

Wednesday, May 18, 2011

/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/implicit_render.rb:5:in `send_action'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/implicit_render.rb:5:in `send_action'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/abstract_controller/base.rb:150:in `process_action'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/rendering.rb:11:in `process_action'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/abstract_controller/callbacks.rb:18:in `process_action'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:436:in `_run__84203013__process_action__199225275__callbacks'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:410:in `send'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:94:in `send'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:94:in `run_callbacks'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/abstract_controller/callbacks.rb:17:in `process_action'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/instrumentation.rb:30:in `process_action'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/notifications.rb:52:in `instrument'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/notifications/instrumenter.rb:21:in `instrument'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/notifications.rb:52:in `instrument'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/instrumentation.rb:29:in `process_action'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/rescue.rb:17:in `process_action'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/abstract_controller/base.rb:119:in `process'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/abstract_controller/rendering.rb:41:in `process'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_controller/metal.rb:138:in `dispatch'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_controller/metal.rb:178:in `action'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/routing/route_set.rb:62:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/routing/route_set.rb:62:in `dispatch'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/routing/route_set.rb:27:in `call'/Library/Ruby/Gems/1.8/gems/rack-mount-0.6.14/lib/rack/mount/route_set.rb:148:in `call'/Library/Ruby/Gems/1.8/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:93:in `recognize'/Library/Ruby/Gems/1.8/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:68:in `optimized_each'/Library/Ruby/Gems/1.8/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:92:in `recognize'/Library/Ruby/Gems/1.8/gems/rack-mount-0.6.14/lib/rack/mount/route_set.rb:139:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/routing/route_set.rb:493:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/head.rb:14:in `call'/Library/Ruby/Gems/1.8/gems/rack-1.2.2/lib/rack/methodoverride.rb:24:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/params_parser.rb:21:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/flash.rb:182:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/cookies.rb:302:in `call'/Library/Ruby/Gems/1.8/gems/activerecord-3.0.7/lib/active_record/query_cache.rb:32:in `call'/Library/Ruby/Gems/1.8/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'/Library/Ruby/Gems/1.8/gems/activerecord-3.0.7/lib/active_record/query_cache.rb:12:in `cache'/Library/Ruby/Gems/1.8/gems/activerecord-3.0.7/lib/active_record/query_cache.rb:31:in `call'/Library/Ruby/Gems/1.8/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/callbacks.rb:46:in `call'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/callbacks.rb:416:in `_run_call_callbacks'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/callbacks.rb:44:in `call'/Library/Ruby/Gems/1.8/gems/rack-1.2.2/lib/rack/sendfile.rb:107:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'/Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/rack/logger.rb:13:in `call'/Library/Ruby/Gems/1.8/gems/rack-1.2.2/lib/rack/runtime.rb:17:in `call'/Library/Ruby/Gems/1.8/gems/activesupport-3.0.7/lib/active_support/cache/strategy/local_cache.rb:72:in `call'/Library/Ruby/Gems/1.8/gems/rack-1.2.2/lib/rack/lock.rb:11:in `call'/Library/Ruby/Gems/1.8/gems/rack-1.2.2/lib/rack/lock.rb:11:in `synchronize'/Library/Ruby/Gems/1.8/gems/rack-1.2.2/lib/rack/lock.rb:11:in `call'/Library/Ruby/Gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/middleware/static.rb:30:in `call'/Library/Ruby/Gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:168:in `call'fuuu.rb:44fuuu.rb:43:in `times'fuuu.rb:43

TL;DRWednesday, May 18, 2011

Embrace Diversity

Wednesday, May 18, 2011

We need a change

Wednesday, May 18, 2011

Generators

class Application def call(request, response) response.write(request, "hello", 200, {})

10.times do |body| response.write(request, body) end

response.close endend

Wednesday, May 18, 2011

Filtersclass Filter def initialize(filter) @filter = filter end

def write(request, body, status = nil, headers = nil) @filter.write(request, body, status, headers) end

def close @filter.close endend

Wednesday, May 18, 2011

Lifecycle Hooks

class Handler def before(request) # Connect to database end

def after(request) # Disconnect endend

Wednesday, May 18, 2011

0

17.5

35

52.5

70

Stack Depth

Rails 2.3 Rails 3.0 Rails 3.1 Rails 3.2?

Stack Depth

Wednesday, May 18, 2011

Time for N Requests

0.01

0.1

1

10

100

10 100 1000 10000

Requests

Rails 2.3 Rails 3.0 Rails 3.2?

Wednesday, May 18, 2011

Avg Requests / time

50

200

350

500

650

10 100 1000 10000

Requests

Rails 2.3 Rails 3.0 Rails 3.2?

Wednesday, May 18, 2011

git log --until="1 year from now"

Wednesday, May 18, 2011

We Must Change

Important things to me

Wednesday, May 18, 2011

Speed

Wednesday, May 18, 2011

Memory

Wednesday, May 18, 2011

Stack Depth

Wednesday, May 18, 2011

Backwards Compat

Wednesday, May 18, 2011

DevelopmentPro Tip™

Wednesday, May 18, 2011

Wednesday, May 18, 2011

Final Words

Wednesday, May 18, 2011

A Message forRails-Core

We will not be here forever

Rails will outlive us

Encourage refactoring

Stop "yes men"

Wednesday, May 18, 2011

Not all features are Tangible

Wednesday, May 18, 2011

Good Abstraction yield

Reusable Code

Wednesday, May 18, 2011

Reusable Codeyield

New Features

Wednesday, May 18, 2011

Your Homework:

Wednesday, May 18, 2011

GO GREEN!

Wednesday, May 18, 2011

Refactor Rails!

Wednesday, May 18, 2011

GO FORTH ANDCODE!

Wednesday, May 18, 2011

♥ THANKS! ♥

Wednesday, May 18, 2011

QUESTIONS?

Wednesday, May 18, 2011