From: "Iñaki Baz Castillo" Date: 2008-09-10T20:24:11+09:00 Subject: Re: How to change the owner of a method in a block? 2008/9/10, Peña, Botp : > From: Iñaki Baz Castillo [mailto:ibc@aliax.net] > # >> Benchmark.realtime { instance_eval 'a=123; a2=a*2; a3=a*3' } > # # => 4.50611114501953e-05 > > that's a string. > > include a block, eg > > > > Benchmark.realtime { a=123; a2=a*2; a3=a*3 } > > => 1.59740447998047e-05 > > > > Benchmark.realtime { instance_eval 'a=123; a2=a*2; a3=a*3' } > > => 7.58171081542969e-05 > > > > Benchmark.realtime { instance_eval {a=123; a2=a*2; a3=a*3} } > > => 2.288818359375e-05 You are right! So using "instance_eval" is ~ 40% slower than running directly the code. Thanks a lot. -- Iñaki Baz Castillo