On Tue, Jan 12, 2010 at 6:07 AM, R. Kumar <sentinel.2001 / gmx.com> wrote:
> If i use something like:
>
>>    
>
> does the rescue set up anything internally that will make this
> inefficient ?

To address the original question, the use of rescue does impart a
small overhead, but unless you are min-maxing performance in a tight
loop somewhere, you can safely disregard the amount of overhead.  This
is also something you can readily test for yourself, BTW:


Benchmark.bm {|bm| bm.report {10000000.times {a.size rescue 'stuff'}}}
      user     system      total        real
  1.480000   0.000000   1.480000 (  1.476450)

Benchmark.bm {|bm| bm.report {10000000.times {a.size}}}
      user     system      total        real
  1.280000   0.000000   1.280000 (  1.283498)



Kirk Haines