Skip to content

Commit

Permalink
Commit PR suggestions by Thiago.
Browse files Browse the repository at this point in the history
- Build all_methods outside the benchmark since we don't want to measure that.
  • Loading branch information
salochara committed Nov 20, 2023
1 parent b72260f commit 7d9f26c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tasks/benchmark.rake
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ require 'faker'
desc 'Benchmarking every Faker generator'
task :benchmark do
count = BenchmarkHelper.all_methods.count
all_methods = BenchmarkHelper.all_methods

Benchmark.bmbm do |x|
x.report("Number of generators: #{count}") do
100.times do
BenchmarkHelper.all_methods.each { |method_name| eval(method_name) }
all_methods.each { |method_name| eval(method_name) }
end
end
end
Expand Down

0 comments on commit 7d9f26c

Please sign in to comment.