[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: comments, line numbers and storing a file in a single string
- From: Asko Kauppi <askok@...>
- Date: Tue, 11 Dec 2007 21:49:40 +0200
(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:
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.