Skip to content

Commit

Permalink
Add benchmark for attr_reader
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Apr 25, 2024
1 parent 66c5d2e commit 9849242
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bench/bench_attr_reader.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require 'benchmark/ips'

Benchmark.ips do |bm|
bm.report("attr_reader") do |i|
Class.new do
while i > 0
i-=1
attr_reader :foo
end
end
end
end

0 comments on commit 9849242

Please sign in to comment.