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 a3d37d9 commit 56639e6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bench/bench_attr_reader.rb
@@ -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 56639e6

Please sign in to comment.