From: Adiel Mittmann Date: 2011-03-17T06:28:38+09:00 Subject: Re: NoMethodError#message takes very long Hi, I discovered what's causing the problem. Ruby's function name_err_mesg_to_str (file error.c, line 929, SVN snapshot), which produces the dreaded message, proceeds as follows: 1. It converts the object that does not possess the method in question to a string, by calling #inspect; 2. If it doesn't like that string (i.e., if it's nil or is bigger than 65 characters), then it creates a simpler representation and use it instead. In other words, if you happen to call a method on an object that doesn't define to_s but that does contain a lot of data, then calling an undefined method and trying to print the resulting exception's message will take a long time because all the data in the object will have to be converted to a string -- just to be discarded. Maybe in a case like this the message should always return the simpler representation of the object instead of calling to_s? -- Adiel Mittmann