Commits

tibbe committed 28e0068

Run the garbage collector before each benchmark

This makes sure that garabage created by previous benchmarks don't
affect the current benchmark.

  • Participants
  • Parent commits 86e4682

Comments (0)

Files changed (1)

File Criterion.hs

   when (fromLJ cfgVerbosity cfg > Normal || estTime > 5) $
     note "collecting %d samples, %d iterations each, in estimated %s\n"
        sampleCount newIters (secs estTime)
+  -- Run the GC to make sure garabage created by previous benchmarks
+  -- don't affect this benchmark.
+  liftIO performGC
   times <- liftIO . fmap (U.map ((/ newItersD) . subtract (envClockCost env))) .
            U.replicateM sampleCount $ do
              when (fromLJ cfgPerformGC cfg) $ performGC