Re: C++ exceptions under Windows x86

  • From: Mike Pall <mike-1301@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sat, 5 Jan 2013 18:37:35 +0100

Szymon Gatner wrote:
> > So check your code for uses of RAII. AFAIR Luabind has (or had?)
> > some of these internally, too.
> 
> In which conditions are destructors dangerous (I assume that is what
> you mean by RAII)?

Any that are in a stack frame between pcall and lua_error.

> What in luabind makes it of higher overhead?

Well, take a look at the code. :-) The overhead is spread out, so
you won't easily notice it on a CPU profile. But you pay for it on
every call to C++.

If the timings at
  http://code.google.com/p/oolua/wiki/Speed_comparisons
are to be trusted, e.g. every call to a virtual function costs
between 600 and 900 cycles (not sure about the CPU frequency this
was measured at). That's awfully slow, considering you could call
a C function pointer (equivalent to a virtual function) via the
FFI at a cost of about 3 to 5 cycles.

--Mike

Other related posts: