lua-users home
lua-l archive

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


You could create a 'master state', load the module in it, then create
subsequent states as threads of the master one, give them a new
globals table, and lua_xmove the module table across.

2008/5/12 Erik Hougaard <erik@hougaard.com>:
> luac should solve your problem.
>
>  /Erik
>
>
>
>  Bronner, Gregory wrote:
>
> > I have a near-realtime server application that
> > - receives a request
> > - creates a lua state
> > - loads a module using 'require'
> > - runs a function in that module.
> >
> > I've found that the loading of the module takes about .5 seconds,  and
> > everything else that I'm doing takes .1 seconds.
> > This is despite setting package.path to one directory on a local disk,
> > running luac on all of the lua files, etc.
> >
> > Since it is loading the same module multiple times, is there some way to
> > 'precompile' it once, and export that precompiled version from one state
> > to another?
> >
> > Is there some other way to improve the startup time of an interpreter?
> >
> > The module isn't very large -- 1700 LOC total.
> > This is all using lua 5.1.3
> >
> > Thanks,
> >
> > Gregory R. Bronner
> > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - - - -
> >
> > This message is intended only for the personal and confidential use of the
> designated recipient(s) named above.  If you are not the intended recipient
> of this message you are hereby notified that any review, dissemination,
> distribution or copying of this message is strictly prohibited.  This
> communication is for information purposes only and should not be regarded as
> an offer to sell or as a solicitation of an offer to buy any financial
> product, an official confirmation of any transaction, or as an official
> statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
> secure or error-free.  Therefore, we do not represent that this information
> is complete or accurate and it should not be relied upon as such.  All
> information is subject to change without notice.
> >
> > --------
> > IRS Circular 230 Disclosure:
> > Please be advised that any discussion of U.S. tax matters contained within
> this communication (including any attachments) is not intended or written to
> be used and cannot be used for the purpose of (i) avoiding U.S. tax related
> penalties or (ii) promoting, marketing or recommending to another party any
> transaction or matter addressed herein.
> >
> >
> >
>
>