[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Recycling the lua_load() output
- From: "Murray S. Kucherawy" <msk@...>
- Date: Wed, 12 Jan 2011 14:19:34 -0800
> -----Original Message-----
> From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org]
> On Behalf Of Sam Roberts
> Sent: Wednesday, January 12, 2011 2:00 PM
> To: Lua mailing list
> Subject: Re: Recycling the lua_load() output
>
> Why would you compile with one state, and use dump, is it supposed to
> be an optimization?
>
> Creating a new state for each execution is likely to be much slower
> than compiling....
Many threads might want to use the compiled function at the same time on different inputs. Each could have its own state, with a copy of the compiled function and the different inputs.
> You're probably better loading once, storing the function, and then
> calling it, in the same state, repeatedly.
That would require serialization of the threads.