lua-users home
lua-l archive

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

(to the original author)

Have you considered compiling the scripts once you read them in, and keeping the precompiled versions in the strings. This would give even better performance, and (maybe) less memory consumption.

See the 'luac' utility for how to precompile scripts, or just pipe things through it?

If there's a fixed number of scripts and they don't change much, people do luac -> bin2c -> c #include, thus compiling everything in the binary itself.


Terry Bayne kirjoitti 11.12.2007 kello 19:34:

I wrote
add a line break appropriate to your system after each line

What I meant is that you for each line you read from your file, you need to append the appropriate line break before storing that line in the string that contains the entire text of the file.