class BenchmarkDriver::Runner::Memory

def run_benchmark(job, context:)

Returns:
  • (BenchmarkDriver::Metrics) -

Parameters:
  • context (BenchmarkDriver::Context) --
  • job (BenchmarkDriver::Runner::Ips::Job) -- - loop_count is not nil
def run_benchmark(job, context:)
  benchmark = BenchmarkScript.new(
    preludes:   [context.prelude, job.prelude],
    script:     job.script,
    teardown:   job.teardown,
    loop_count: job.loop_count,
  )
  with_script(benchmark.render) do |path|
    output = IO.popen([*@time_command, *context.executable.command, path], err: [:child, :out], &:read)
    if $?.success?
      extract_maxresident_from_time_output(output)
    else
      $stdout.print(output)
      BenchmarkDriver::Result::ERROR
    end
  end
end