lua-users home
lua-l archive

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


Glenn Maynard wrote:
[...]
> 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.
[...]
> -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 gcc is that? gcc 2.95 and gcc 4 use radically different exception
mechanisms (don't know about gcc 3). gcc 4 does call setjmp on try{}, but
instead using an exotic table-based mechanism for figuring out whether the
program counter was in a try block when the exception is thrown, which should
radically change (reduce?) the footprint. Also, use much less stack.

-- 
┌── dg@cowlark.com ─── http://www.cowlark.com ───────────────────
│
│ "There does not now, nor will there ever, exist a programming language in
│ which it is the least bit hard to write bad programs." --- Flon's Axiom

Attachment: signature.asc
Description: OpenPGP digital signature