benchmark_driver 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -0
- data/exe/benchmark-driver +1 -1
- data/lib/benchmark/driver/version.rb +1 -1
- data/lib/benchmark/runner/eval.rb +18 -23
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0db10fa25abfa1459fbd5e1f0360753c86ad991062884e52a41ab9b84d68a5a4
|
4
|
+
data.tar.gz: 74f069de9a28c2d58de873d951ec1d1583bc79adce2f1b01de40545c878e594f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 381376d256dbbe0a791748374313d551005bf1dd3e5b1f493da0fac6cded2eb3b7964e04f4c816bebd0237f2d11bd1ced5ae81dc47a0c0185a8693ab30084911
|
7
|
+
data.tar.gz: 2c4837a1731d15f722e444f2367f96359327932d55d51286d6d4ecb5590d5bf3e5b7eb92dafee7dd52de44cec15dc958eed4d2c61230c649c6a12f640543a819
|
data/CHANGELOG.md
CHANGED
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
|
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|
|
@@ -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
|
-
|
105
|
-
benchmark.
|
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
|
-
|
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
|
-
|
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
|
123
|
+
def overhead(times)
|
125
124
|
raise ArgumentError.new("Negative times: #{times}") if times < 0
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
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
|
134
|
+
def full_script(times)
|
138
135
|
raise ArgumentError.new("Negative times: #{times}") if times < 0
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
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
|