$ time ruby -e'a=(1..200000).to_a; a.classx'
-e:1: undefined method `classx' for #<Array:0x4027c18c> (NoMethodError)

real    0m3.768s
user    0m1.640s
sys     0m0.010s

$ time ruby -e'a=(1..200000).to_a; b=nil; b.classx'
-e:1: undefined method `classx' for nil:NilClass (NoMethodError)

real    0m0.288s
user    0m0.140s
sys     0m0.010s

$ time ruby -e'a=(1..400000).to_a; a.classx'
-e:1: undefined method `classx' for #<Array:0x4027c18c> (NoMethodError)

real    0m9.448s
user    0m3.980s
sys     0m0.050s

$ time ruby -e'a=(1..400000).to_a; b=[]; b.classx'
-e:1: undefined method `classx' for []:Array (NoMethodError)

real    0m0.550s
user    0m0.260s
sys     0m0.020s

$ time ruby -e'a=(1..1000000).to_a; a.classx'
-e:1: undefined method `classx' for #<Array:0x4027c18c> (NoMethodError)

real    0m36.652s
user    0m16.040s
sys     0m0.090s

$ time ruby -e'a=(1..1000000).to_a; b=1; b.classx'
-e:1: undefined method `classx' for 1:Fixnum (NoMethodError)

real    0m1.593s
user    0m0.690s
sys     0m0.010s


Why does it take longer and longer for Ruby to throw NoMethodError for 
large arrays? What is going on here? This happens with hash too.

-- 
dave