Class: BenchmarkerTestRunner
- Inherits:
-
Object
- Object
- BenchmarkerTestRunner
- Defined in:
- lib/perete.rb
Constant Summary collapse
- DIRECTORY =
"benchmarks/previous_runs/"
Instance Method Summary collapse
Instance Method Details
#execute_and_compare ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/perete.rb', line 6 def execute_and_compare Dir["./benchmarks/*.rb"].each { |file| require file } Benchmarks.constants .select { |x| x != :Benchmarker } .each do |klass| puts "Benchmarking #{klass}" benchmark_object = eval("Benchmarks::#{klass}.new") benchmark_object.setup Benchmark.ips do |x| x.config(time: 30, warmup: 3, iterations: 1) x.report(klass) { benchmark_object.execute } end benchmark_object.teardown end end |