From: Tadashi Saito Date: 2007-12-24T06:06:08+09:00 Subject: [PATCH] RDoc update for Array#at Hi, Thanks to brand new VM's specialized instructions, now Array#at seems _slower_ than Array#[]. $ ruby-trunk -rbenchmark -ve 'a=Array.new(1000){ rand } puts Benchmark.measure{ 1000_000.times{ a.at(500) } }' ruby 1.9.0 (2007-12-24 revision 0) [i686-linux] 0.590000 0.000000 0.590000 ( 0.616355) $ ruby-trunk -rbenchmark -ve 'a=Array.new(1000){ rand } puts Benchmark.measure{ 1000_000.times{ a[500] } }' ruby 1.9.0 (2007-12-24 revision 0) [i686-linux] 0.430000 0.000000 0.430000 ( 0.451910) So it would be better to remove obsolete description. Index: array.c =================================================================== --- array.c (revision 14556) +++ array.c (working copy) @@ -767,8 +767,6 @@ * Returns the element at _index_. A * negative index counts from the end of _self_. Returns +nil+ * if the index is out of range. See also Array#[]. - * (Array#at is slightly faster than Array#[], - * as it does not accept ranges and so on.) * * a = [ "a", "b", "c", "d", "e" ] * a.at(0) #=> "a" -- Tadashi Saito