lua-users home
lua-l archive

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


Hi,

David Burgess wrote:
> Your platform and compiler?

gcc/g++ 3.3.4, glibc 2.3.4, Linux 2.6.

lua -e 'for i=1,1e6 do pcall(error,"foo") end'

gcc: 1.5s vs. g++: 64s

Yes, I realize that a benchmark with a 1:1 ratio of error:pcall is
completely artificial. But that does not change my point: avoid throwing
tons of errors when you compile the core with C++.

skaller wrote:
> So? One is a primitive low level operation,
> the other is a much higher level. C++ handles
> stack unwinding, selective catching on type,
> multiple levels of handlers, and decoupled
> throwing and catching.

Sure, but I wasn't aware that it's _that_ slow. And unnecessary for the
Lua core at least.

Bye,
     Mike