lua-users home
lua-l archive

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


On Fri, May 8, 2015 at 11:27 AM, Coda Highland <chighland@gmail.com> wrote:
On Fri, May 8, 2015 at 11:24 AM, Brigham Toskin <brighamtoskin@gmail.com> wrote:
> One, I'd like to keep the code all in Lua for now. I had considered
> implementing some code in C before; that would be nice and zippy, but then
> makes building/installation more cumbersome, and the C code that interfaces
> with Lua is by nature rather ugly and complex. I might consider this kind of
> thing in the future if it turns out I need more performance than I can
> squeeze out of thoughtfully-written Lua code, but I'm not convinced it would
> be a big win for me.

Using the C API will make LuaJIT's performance bottom out. If you're
worried about performance across VMs, stick to pure Lua.

Thanks for that insight. It would have to be the case that calling into C would have the same limitations as coroutines for luajit—the tracer can't cross that boundary to optimize the full path. If it were really critical, one could always load a C module for your slowest critical section if you detect you're running vanilla Lua, and rely on the jit otherwise. That's perfectly valid, but I'm not there yet.

--
Brigham Toskin