[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: luajit ffi - calling a luajit function via a C function pointer?
- From: Mike Pall <mikelu-1102@...>
- Date: Thu, 10 Feb 2011 18:53:52 +0100
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