[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: The Lua interpreter and large scripts
- From: Sean Conner <sean@...>
- Date: Wed, 11 Nov 2009 16:03:41 -0500
It was thus said that the Great Mike Pall once stated:
> Luiz Henrique de Figueiredo wrote:
> > > The "-i" option loads readline which as a side-effect initializes
> > > the NLS locale for the current process from the environment variables.
> > If available, readline is compiled into the interpreter. You don't need
> > to use -i to activate it. Do you mean that when you do use interactive
> > input then a function from the readline library gets called and only then
> > the OS loads the readline library? And so readline is not loaded at all
> > when running the interpreter in batch?
> I should have been more precise. The shared library is always
> loaded (which is a waste without -i). The first time a readline
> function is called (only with -i), it's initialized and it sets
> the locale.
> You can verify that by comparing the output of these two commands:
> strace -e open lua -v
> strace -e open lua -i </dev/null
> If you have the environment variables LANG or LC_* set, the output
> of the 2nd command shows it opens lots of locale related files.
I also did a generic build of Lua, to avoid the whole readline issue and
the results are the same as before: "lua -i show.lua /
dofile('default.lua')" takes 6 minutes, other combinations take 15 seconds
-spc (Just in case anyone asks)