Re: Aggressive exception handler making extra work for itself.

Jonathan Swartz <[email protected]> Mon, 2 Apr 2007 15:40:34 -0700
Newsgroups gmane.comp.web.mason.devel
Message-ID <[email protected]>
On Apr 2, 2007, at 3:27 PM, David E. Wheeler wrote:

> On Apr 2, 2007, at 15:12, Jonathan Swartz wrote:
>
>> I noticed this behavior while investigating performance at Amzn, but
>> then forgot about it. I agree - we should only use Devel::StackTrace
>> when needed by our error messages, and perhaps we should allow its
>> use to be turned on/off with a parameter at any rate.
>>
>> Jesse/Dave, have you come up with a workaround or fix for this yet?
>
> Personally I'd like to see something in Exception::Class to turn off
> the generation of stack traces when they're not needed. I mean,
> they're not necessary for aborts, for example—which is to say, when
> they're used to control program flow.

Yes, that might be better, since the stack trace generation is almost  
certainly the bulk of the cost.

For Mason's purposes, we would need to be able to turn on/off stack  
traces in a dynamically scoped way (e.g. by setting an  
Exception::Class package var), since we want all errors that occur  
inside the request to convert to an Exception::Class object, and  
error_mode can change on a per-request basis.

Jon


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV