[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.1.1 LOADNIL optimization bug
- From: Mike Pall <mikelu-0703@...>
- Date: Wed, 21 Mar 2007 17:20:56 +0100
Hi,
Julien Hamaide wrote:
> > IMHO the patch is wrong. One needs to check that the assigned
> > variable is a new one and not a parameter. Only then can the
> > first LOADNILs be omitted. But this requires restructuring ...
> >
> > The other option is to scrap this micro-optimization entirely.
> > IMHO it's not going to make any notable difference in speed.
>
> In some ways, I've scrapped this micro-optimization when LOADNIL is
> first instruction with the patch, while keeping it for other case. I
> don't understand what's the difference with your solution.
Oops. On closer look, you're right. Sorry.
I've assumed a reverse diff of luaK_nil between Lua-5.1-alpha and
beta would do. But the initialization of fs->lasttarget changed.
So, the optimal fix is to set fs->lasttarget to 0 in open_func()
and just remove the check for l->pc == 0 in luaK_nil. Your patch
is functionally identical.
Bye,
Mike