From: Adiel Mittmann Date: 2011-03-16T21:15:28+09:00 Subject: Re: NoMethodError#message takes very long Hello. On Wed, Mar 16, 2011 at 03:24:29PM +0900, Eric Hodel wrote: > Let me see if I have this straight: > > If baz.xml is empty it is fast > If baz.xml is large it is slow > > If this is true it is because it takes time to parse the XML file before it gets to foo and discovers that there is no method foo. > > Ruby does not know that foo does not exist until you try to call it. The thing is: if method foo is not called at all, and thus no exception is raised, the resulting web page is shown quickly enough. Nokogiri is pretty fast at parsing XML files. It only takes long when the inexistent method foo() is called and the pogram tries to print the exception message. Yes, I know this is *very*, *very* weird. Can anybody try to reproduce this bug? The code snippet is very simple and it shouldn't take more than a couple minutes. Thanks for the reply. -- Adiel Mittmann