lua-users home
lua-l archive

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


On Fri, Jan 26, 2007 at 11:18:58AM +0000, David Given wrote:
> 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
(did you mean doesn't call ... uses?)
> program counter was in a try block when the exception is thrown, which should
> radically change (reduce?) the footprint. Also, use much less stack.

That's 3.3.  It doesn't call setjmp, but just increases the stack by
16 bytes.  The extra space is mostly those huge tables.  It seems their
design was "no runtime overhead, but to hell with binary size", which is
just not acceptable.  I might take a 5% penalty for the convenience of
exceptions, but 33%?  I'll do without ...

-- 
Glenn Maynard