[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: simplest way to trap error in lua?
- From: Glenn Maynard <glenn@...>
- Date: Thu, 25 Jan 2007 20:52:23 -0500
On Thu, Jan 25, 2007 at 03:26:59PM -0500, Rici Lake wrote:
> Experiments in C have convinced me that setjmp/longjmp exception
> handling is quite reasonable, and often outperforms c++ exceptions.
longjmp will probably outperform throw, but that's rarely an
optimization point. I doubt setjmp will outperform try, which
just allocates (in g++) a bit more stack space, and doesn't
add any instructions to the non-exceptional code path.
But, there's another cost of C++ exceptions:
-rwxr-xr-x 1 glenn users 6186780 Jan 25 20:41 stepmania* (stripped)
-rwxr-xr-x 1 glenn users 4653388 Jan 25 20:41 stepmania* (stripped, -fno-exceptions)
... which is insane.
--
Glenn Maynard