Skip to content

Instantly share code, notes, and snippets.

@vladvinnikov
Created March 17, 2012 18:18
Show Gist options
  • Save vladvinnikov/2063777 to your computer and use it in GitHub Desktop.
Save vladvinnikov/2063777 to your computer and use it in GitHub Desktop.
Rails rspec speedup
http://blog.carbonfive.com/2011/02/02/crank-your-specs/
https://makandracards.com/makandra/950-speed-up-rspec-by-deferring-garbage-collection
https://github.com/tmm1/perftools.rb
RUBY_HEAP_MIN_SLOTS=500000
RUBY_HEAP_SLOTS_INCREMENT=500000
RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
RUBY_GC_MALLOC_LIMIT=100000000
RUBY_HEAP_FREE_MIN=500000
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || retrieve_connection
end
end
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
config.use_transactional_fixtures = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment