Skip to content

Commit

Permalink
Some one-line blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzedge committed May 12, 2023
1 parent c2c021d commit f6311d7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
4 changes: 1 addition & 3 deletions tasks/performance/reporters/benchmark.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ def measure iterations, param

require 'benchmark'
measure = ::Benchmark.measure do
iterations.times do
result = yield param
end
iterations.times { result = yield param }
end

output.puts result.to_s.ljust 10
Expand Down
6 changes: 1 addition & 5 deletions tasks/performance/reporters/flamegraph.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ def do_report iterations, params

require 'flamegraph'
::Flamegraph.generate filepath do
params.each do |param|
iterations.times do
yield param
end
end
params.each { |p| iterations.times { yield p } }
end
end

Expand Down
6 changes: 1 addition & 5 deletions tasks/performance/reporters/memory_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ def do_report iterations, params
ignore_files: 'lib/rambling/trie/tasks',
) do
with_gc_stats "performing #{filename}" do
params.each do |param|
iterations.times do
yield param
end
end
params.each { |p| iterations.times { yield p } }
end
end

Expand Down

0 comments on commit f6311d7

Please sign in to comment.