# File lib/railsbench/perf_utils.rb, line 140
def perf_run_gc(script, iterations, options, raw_data_file)
  warmup = "-warmup"
  warmup = "" if options =~ /-warmup/

  enable_gc_stats(raw_data_file)
  set_gc_variables([options])

  perf_options = "#{iterations} #{warmup} #{options}"
  null = (RUBY_PLATFORM =~ /win32/) ? 'nul' : '/dev/null'

  perf_cmd = "ruby #{RAILSBENCH_BINDIR}/run_urls #{perf_options} >#{null}"
  print_cmd = "ruby #{RAILSBENCH_BINDIR}/perf_times_gc #{raw_data_file}"

  puts "benchmarking GC performance with options #{perf_options}"
  puts

  system(perf_cmd) || die("#{script}: #{perf_cmd} returned #{$?}")

  disable_gc_stats
  unset_gc_variables
  system(print_cmd) || die("#{script}: #{print_cmd} returned #{$?}")
end