From: Marc-Andre Lafortune Date: 2011-06-27T03:44:51+09:00 Subject: [ruby-core:37544] Re: [Ruby 1.9 - Feature #4917] NilClass#to_ary Hi, On Sun, Jun 26, 2011 at 12:42 PM, Jay Feldblum wrote: > > This minor performance issue becomes a huge problem when NilClass#method_missing is defined, such as in ActiveSupport Thanks for showing the performance impacts of defining NilClass#method_missing as ActiveSupport does. Instead of subverting the language (since `nil` is not an Array, as Yui Naruse and I pointed out and thus should not respond to `to_ary`), you could ask ActiveSupport to reimplement the whiny nil feature by rescuing NoMethodErrors at the top level, parsing them and rewriting them if the object called was `nil` and the method is recognized (or to define NilClass#to_ary, even though I feel it's not a great idea) It is possible that they will suggest you simply turn off the whiny nil feature (config.whiny_nils = false) in the environment in which you have performance issues. -- Marc-Andr�