benchmark_driver 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0124b5599ebca85abc849c7839e03a0f455a3e5b509a837ee66a70fc99c01c95
4
- data.tar.gz: 7f3b32fd2fdeccb56c2fac56a3196accbd8e1fd3da44e6927c3612751b7a2ae9
3
+ metadata.gz: 0db10fa25abfa1459fbd5e1f0360753c86ad991062884e52a41ab9b84d68a5a4
4
+ data.tar.gz: 74f069de9a28c2d58de873d951ec1d1583bc79adce2f1b01de40545c878e594f
5
5
  SHA512:
6
- metadata.gz: e9c0e3c486a09d47c23d1b79ad673d7bd9ee8c7477fda8f3eea974a4f663d3c062c2092e56e8fbbeab38298b982134e6a5f5c30198a0a761ba1d4197cba12544
7
- data.tar.gz: cfeb3f8f232964221a34a3bab7e27285a561b53214e9aff4f8441e372217ba94b66f26cd7ca43cb770d23d15f824efc915dc7fafdb87db43d48c7cac24689e26
6
+ metadata.gz: 381376d256dbbe0a791748374313d551005bf1dd3e5b1f493da0fac6cded2eb3b7964e04f4c816bebd0237f2d11bd1ced5ae81dc47a0c0185a8693ab30084911
7
+ data.tar.gz: 2c4837a1731d15f722e444f2367f96359327932d55d51286d6d4ecb5590d5bf3e5b7eb92dafee7dd52de44cec15dc958eed4d2c61230c649c6a12f640543a819
data/CHANGELOG.md CHANGED
@@ -1,3 +1,4 @@
1
+ # v0.8.1
1
2
  # v0.8.0
2
3
 
3
4
  - Force using :exec runner for YAML interface
data/exe/benchmark-driver CHANGED
@@ -77,7 +77,7 @@ end
77
77
  # Proceed parsed options
78
78
  #
79
79
  config = Benchmark::Driver::Configuration.new(jobs)
80
- config.runner_options = Benchmark::Driver::Configuration::RunnerOptions.new(:exec)
80
+ config.runner_options = Benchmark::Driver::Configuration::RunnerOptions.new
81
81
  config.output_options = Benchmark::Driver::Configuration::OutputOptions.new(:ips)
82
82
 
83
83
  options.each do |key, value|
@@ -1,5 +1,5 @@
1
1
  module Benchmark
2
2
  module Driver
3
- VERSION = '0.8.0'
3
+ VERSION = '0.8.1'
4
4
  end
5
5
  end
@@ -101,17 +101,16 @@ class Benchmark::Runner::Eval
101
101
 
102
102
  def eval_times(job, times)
103
103
  benchmark = BenchmarkScript.new(job.prelude, job.script)
104
- mod = Module.new
105
- benchmark.compile_overhead!(mod, times)
106
- benchmark.compile_full_script!(mod, times)
104
+ overhead = benchmark.overhead(times)
105
+ full_script = benchmark.full_script(times)
107
106
 
108
107
  before = Benchmark::Driver::Time.now
109
- mod.overhead
108
+ eval(overhead, TOPLEVEL_BINDING)
110
109
  after = Benchmark::Driver::Time.now
111
110
  overhead_duration = after.to_f - before.to_f
112
111
 
113
112
  before = Benchmark::Driver::Time.now
114
- mod.full_script
113
+ eval(full_script, TOPLEVEL_BINDING)
115
114
  after = Benchmark::Driver::Time.now
116
115
  full_script_duration = after.to_f - before.to_f
117
116
 
@@ -121,31 +120,27 @@ class Benchmark::Runner::Eval
121
120
  class BenchmarkScript < Struct.new(:prelude, :script)
122
121
  BATCH_SIZE = 1000
123
122
 
124
- def compile_overhead!(mod, times)
123
+ def overhead(times)
125
124
  raise ArgumentError.new("Negative times: #{times}") if times < 0
126
- mod.module_eval(<<-RUBY)
127
- def self.overhead
128
- #{prelude}
129
- __benchmark_driver_i = 0
130
- while __benchmark_driver_i < #{times / BATCH_SIZE}
131
- __benchmark_driver_i += 1
132
- end
125
+ <<-RUBY
126
+ #{prelude}
127
+ __benchmark_driver_i = 0
128
+ while __benchmark_driver_i < #{times / BATCH_SIZE}
129
+ __benchmark_driver_i += 1
133
130
  end
134
131
  RUBY
135
132
  end
136
133
 
137
- def compile_full_script!(mod, times)
134
+ def full_script(times)
138
135
  raise ArgumentError.new("Negative times: #{times}") if times < 0
139
- mod.module_eval(<<-RUBY)
140
- def self.full_script
141
- #{prelude}
142
- __benchmark_driver_i = 0
143
- while __benchmark_driver_i < #{times / BATCH_SIZE}
144
- __benchmark_driver_i += 1
145
- #{"#{script};" * BATCH_SIZE}
146
- end
147
- #{"#{script};" * (times % BATCH_SIZE)}
136
+ <<-RUBY
137
+ #{prelude}
138
+ __benchmark_driver_i = 0
139
+ while __benchmark_driver_i < #{times / BATCH_SIZE}
140
+ __benchmark_driver_i += 1
141
+ #{"#{script};" * BATCH_SIZE}
148
142
  end
143
+ #{"#{script};" * (times % BATCH_SIZE)}
149
144
  RUBY
150
145
  end
151
146
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benchmark_driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun