2022-09-14 16:48:40 -04:00
|
|
|
prelude: |
|
2022-09-14 20:39:39 -04:00
|
|
|
class Example
|
2022-09-14 16:48:40 -04:00
|
|
|
def lazy_set
|
|
|
|
@uninitialized ||= 123
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
objs = 10000000.times.map { Example.new }
|
|
|
|
benchmark:
|
|
|
|
vm_ivar_lazy_set: |
|
|
|
|
objs.each(&:lazy_set)
|
|
|
|
loop_count: 1
|