If you noticed spork startup getting slower when switching to Rails 2.3, your not alone ;)

  • Views are eager loaded
  • app/ is eager loaded (when config.cache_classes is on)

Without hack: 18s startup
With hack: 2s startup :D

Try it

#spec/spec_helper.rb
begin
  require 'spork/app_framework/rails'
  module Spork::AppFramework::Rails::NinjaPatcher
    # views are preloaded  spork must be restarted for view changes
    def delay_eager_view_loading
      puts "removed because i am too slow..."
    end

    # do not preload application files
    # alternatively urn off config.cache_classes
    def delay_app_preload
      ::Rails::Initializer.send(:define_method, :load_application_classes) do
      end
    end
  end
rescue
end

Spork.prefork do
  ...
About these ads