V
Victor 'Zverok' Shepelev
For some reasons I extensively use this technique:
obj =3D MyClass=2Enew(=2E=2E=2E)
obj=2Einstance_eval{
def my_cool_method
end
}
#create 1000 clones of the obj, call #my_cool_method
(1=2E=2E1000)=2Ecollect{
clon =3D obj=2Eclone
clon=2Emy_cool_method
}
The problem is ruby-prof shows each clone's #my_cool_method as separate on=
e in the report, so I see 1000 lines with 1 calls of #my_cool_method inste=
ad of 1 line with 1000 calls=2E Is it bug or by design? May this problem b=
e result of the fact I use latest Ruby 1=2E9 version?
Thanks=2E
V=2E
obj =3D MyClass=2Enew(=2E=2E=2E)
obj=2Einstance_eval{
def my_cool_method
end
}
#create 1000 clones of the obj, call #my_cool_method
(1=2E=2E1000)=2Ecollect{
clon =3D obj=2Eclone
clon=2Emy_cool_method
}
The problem is ruby-prof shows each clone's #my_cool_method as separate on=
e in the report, so I see 1000 lines with 1 calls of #my_cool_method inste=
ad of 1 line with 1000 calls=2E Is it bug or by design? May this problem b=
e result of the fact I use latest Ruby 1=2E9 version?
Thanks=2E
V=2E