[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: boolean operators
- From: Glenn Maynard <glenn@...>
- Date: Thu, 28 Sep 2006 18:53:10 -0400
On Thu, Sep 28, 2006 at 10:46:58PM +0000, David Given wrote:
> arg = "5"
> print (arg+0)
>
> Likewise, some compiler sugar to convert to treat '+a' as '0+a' would be
> easy, not involve any additional opcodes, and would optimise away to
> nothing in most cases.
echo 'for i = 1,10000000 do local a = 5*(i); end' | time luac -l -
echo 'for i = 1,10000000 do local a = 5*(0+i); end' | time luac -l -
Lua's compiler doesn't do much (any?) optimization.
--
Glenn Maynard
- References:
- Re: boolean operators, Glenn Maynard
- Re: boolean operators, Rici Lake
- Re: boolean operators, Glenn Maynard
- Re: boolean operators, Rici Lake
- Re: boolean operators, Glenn Maynard
- Re: boolean operators, Rici Lake
- Re: boolean operators, Glenn Maynard
- Re: boolean operators, David Jones
- Re: boolean operators, Nick Gammon
- Re: boolean operators, David Given