[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Trace compilation from embedded LuaJIT
- From: Douglas Creager <dcreager@...>
- Date: Wed, 3 Aug 2011 21:02:10 -0400
> How about moving the data processing loop into Lua (for both the custom Lua
> callbacks and any other C callbacks).
>
> while true do
> local record = get_next_record()
> if not record then return end
> -- call call all c/lua per-record callbacks
> for i=1,#callbacks do
> callbacks[i](record)
> end
> -- cleanup record
> cleanup_record(record)
> end
>
> If you are worried about the speed when not using LuaJIT, then have another
> version of that loop written in C.
Yeah, we're looking at that as a solution, too, though it would involve rewriting a fair bit of existing C code in Lua. I wanted to see if there were alternative suggestions before we went too far down that path.
–doug