lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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