Class: Benchmark::Runner::Exec
- Inherits:
-
Object
- Object
- Benchmark::Runner::Exec
- Defined in:
- lib/benchmark/runner/exec.rb
Overview
Run benchmark by executing another Ruby process.
Multiple Ruby binaries: o Memory output: o
Defined Under Namespace
Classes: BenchmarkScript
Constant Summary collapse
- SUPPORTED_FIELDS =
This class can provide fields in ‘Benchmark::Driver::BenchmarkResult` if required by output plugins.
[:real, :max_rss]
- WARMUP_DURATION =
1
- BENCHMARK_DURATION =
4
- GUESS_TIMES =
[1, 1_000, 1_000_000, 10_000_000, 100_000_000]
- GUESS_THRESHOLD =
400ms
0.4
Instance Method Summary collapse
-
#initialize(options, output:) ⇒ Exec
constructor
A new instance of Exec.
- #run(config) ⇒ Object
Constructor Details
#initialize(options, output:) ⇒ Exec
Returns a new instance of Exec.
25 26 27 28 |
# File 'lib/benchmark/runner/exec.rb', line 25 def initialize(, output:) @options = @output = output end |
Instance Method Details
#run(config) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/benchmark/runner/exec.rb', line 31 def run(config) validate_config(config) if config.jobs.any?(&:warmup_needed?) run_warmup(config.jobs) end @output.start_running config.jobs.each do |job| @output.running(job.name) @options.executables.each do |executable| result = run_benchmark(job, executable) @output.benchmark_stats(result) end end @output.finish end |