lua-users home
lua-l archive

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


> I integrate LUA with my program using huge of equations in 
> LUA, I am looking
> for
> some way to execute faster and used less memory and database 
> volume to store
> the equations.
> 
> Any one know about ability to pre-compile and load 
> intermediate code in LUA.
> Is possible to pre-compile LUA program to intermediate code,  
> then store
> that code in database,
> later load it to run in LUA?

You can use luac to compile code into binary VM form, then you can execute
this (but TBH the Lua compiler is very quick so you must have an enormous
quantity of code!) You can then use bin2c to turn the binary into a file
which you can just include in your code to save loading the file.

If you'd like an example, have a look at http://doris.sf.net/

Regards,
Nick