Created
December 6, 2011 11:54
Revisions
-
josevalim revised this gist
Dec 6, 2011 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,8 @@ # THANKS EVERYONE FOR YOUR BELOVED BENCHMARKS. # THIS PATCH IS NOW IN RAILS: # # https://github.com/rails/rails/commit/885a599303585b796da7a0a1c3ccd0bc5c642134 # Please add the following lines after Bundler.require # and before "class Application < Rails::Application" # in your config/application.rb -
josevalim revised this gist
Dec 6, 2011 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,8 +4,8 @@ # # Notice this is just an experiment, don't leave those # lines there after the experiment. Then please benchmark # your app boot time in development before and after adding # those lines. A simple benchmark is: # # time script/rails runner "MODEL" # @@ -19,8 +19,9 @@ # This patch should work on Rails 3.0, 3.1 and master. # # Extra: if you could run your app in development and # production (in your machine!!) with this patch on # for a couple minutes and report any errors, you will # win extra <3 <3 <3. require "active_support/dependencies" -
josevalim revised this gist
Dec 6, 2011 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,9 @@ # # time script/rails runner "MODEL" # # Where MODEL is a model available in your app. Also, # please run the command above at least three times to # ensure we don't have fake samples. :) # # Please post the results in the comments below of the # benchmarks before and after adding the code. <3 -
josevalim created this gist
Dec 6, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ # Please add the following lines after Bundler.require # and before "class Application < Rails::Application" # in your config/application.rb # # Notice this is just an experiment, don't leave those # lines there after the experiment. Then please benchmark # your app boot time before and after adding those lines. # A simple benchmark is: # # time script/rails runner "MODEL" # # Where MODEL is a model available in your app. # # Please post the results in the comments below of the # benchmarks before and after adding the code. <3 # # This patch should work on Rails 3.0, 3.1 and master. # # Extra: if you could run your app in development and # production (in your machine!!) with this patch and # report any errors you will win extra <3 <3 <3. require "active_support/dependencies" ActiveSupport::Dependencies::WatchStack.class_eval do def watching? !@watching.empty? end end def load_dependency(file) if ActiveSupport::Dependencies.load? && ActiveSupport::Dependencies.constant_watch_stack.watching? ActiveSupport::Dependencies.new_constants_in(Object) { yield } else yield end rescue Exception => exception # errors from loading file exception.blame_file! file raise end