From 78cb48cea0b14eabdfd728c2f9fc183f587faded Mon Sep 17 00:00:00 2001 From: Daniel Pittman Date: Fri, 8 Apr 2011 13:39:37 -0700 Subject: maint: disable garbage collector during individual test cases. This reduced overhead of garbage collection from 50 percent to 20 percent in my test runs, and reduced wall-time to match. This seems to be a reasonable win: we allow the GC to run on demand, but only outside the testing. Memory use went from ~ 300MB to ~550MB between runs, which suggests that we are generating a *lot* of garbage at times, but that we also benefit from cleaning it automatically on a regular basis. Reviewed-By: Matt Robinson --- spec/spec_helper.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fc63c6d19..e8ab66611 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -38,6 +38,8 @@ RSpec.configure do |config| config.mock_with :mocha config.before :each do + GC.disable + # these globals are set by Application $puppet_application_mode = nil $puppet_application_name = nil @@ -65,6 +67,8 @@ RSpec.configure do |config| @logs.clear Puppet::Util::Log.close_all + + GC.enable end end -- cgit