lua-users home
lua-l archive

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

On Friday 22 September 2006 3:58 pm, Mike Pall wrote:
> Note that the main speed disadvantage of functions vs. operators
> (around 5x) in interpreted Lua is due to the call frame setup and
> teardown overhead. One way to speed this up would be to add
> "frameless" C functions which operate in the frame of the caller.
> Especially trivial functions (math.*) would benefit a lot.

For context - why is it that C functions need setup?

Its simpler, I imagine, I don't have to worry about stack balancing, and
I can't damage the stack I was called from in my C functions.

Is it purely to protect lua-land from C, or are there other reasons?