[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua registry, environment, and threads.
- From: steve donovan <steve.j.donovan@...>
- Date: Sat, 9 Jan 2010 15:14:09 +0200
On Sat, Jan 9, 2010 at 3:08 PM, Leo Razoumov <slonik.az@gmail.com> wrote:
> Calling loadstring 'return x + y' hurts performance especially if used
> multiple times. For me Lua's getfenv/setfenv was a killer feature very
> useful in multiple passes over the same dataset in statistical data
> analysis.
Well, exactly. We always tell newbies to cache the result of compiling
expressions.
We are ending up with a catalogue of useful/essential things that
cannot not be done without setfenv.
(BTW, a safer 5.2 idom is:
local loadstring = loadstring
in {x = 1, y = 10} do fn = loadstring 'return x + y' end
Given that loadstring is potentially a nasty function in a sandbox)
steve d.
- References:
- Lua registry, environment, and threads., Christian Tellefsen
- Re: Lua registry, environment, and threads., Roberto Ierusalimschy
- Re: Lua registry, environment, and threads., Enrico Colombini
- Re: Lua registry, environment, and threads., Roberto Ierusalimschy
- Re: Lua registry, environment, and threads., Edgar Toernig
- Re: Lua registry, environment, and threads., Mark Hamburg
- Re: Lua registry, environment, and threads., Leo Razoumov
- Re: Lua registry, environment, and threads., steve donovan
- Re: Lua registry, environment, and threads., steve donovan
- Re: Lua registry, environment, and threads., Leo Razoumov