lua-users home
lua-l archive

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


Leo Razoumov wrote:
> When one calls back from C into Lua using conventional lua_call(...)
> does LuaJIT2 traces and optimizes the lua function call?

The problem is with the Lua/C API, the overhead is in the API
itself, not in any Lua code. The C to Lua transition is even more
costly than the Lua to C transition. I can't change the Lua C/API,
but you can stop using it.

In other words: don't do this in performance sensitive parts of
your applications. Write everything in Lua. And if you must, then
put C functionality in libraries callable from the FFI.

--Mike