[ANN] Lua 5.4.0 (work2) now available

classic Classic list List threaded Threaded
78 messages Options
1234
Reply | Threaded
Open this post in threaded view
|

[ANN] Lua 5.4.0 (work2) now available

Luiz Henrique de Figueiredo
Lua 5.4.0 (work2) is now available for testing at
        http://www.lua.org/work/lua-5.4.0-work2.tar.gz

The checksums are
        MD5     3cdf2a4eb84dde6b6aaf5d2d1de07be9  -
        SHA1    e8484e61c5c338e3ec2f75dbe0f6703d079fecf9  -

This is a work version. All details may change in the final version.

An updated reference manual is included and also available at
        http://www.lua.org/work/doc

The complete diffs from work1 to work2 are available at
        http://www.lua.org/work/diffs-lua-5.4.0-work1-work2.html
        http://www.lua.org/work/diffu-lua-5.4.0-work1-work2.html

Previous work versions are available at
        http://www.lua.org/work/

The focus of Lua 5.4.0 is performance. We're especially interested in
feedback about its performance but all feedback is welcome. Thanks.
--lhf

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.4.0 (work2) now available

Dibyendu Majumdar
On 18 June 2018 at 21:33, Luiz Henrique de Figueiredo
<[hidden email]> wrote:
> Lua 5.4.0 (work2) is now available for testing at
>         http://www.lua.org/work/lua-5.4.0-work2.tar.gz
>

Congratulations! Is there a test pack yet?

Thanks and Regards
Dibyendu

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.4.0 (work2) now available

Italo Maia
That looks really nice!

2018-06-18 23:16 GMT+02:00 Dibyendu Majumdar <[hidden email]>:
On 18 June 2018 at 21:33, Luiz Henrique de Figueiredo
<[hidden email]> wrote:
> Lua 5.4.0 (work2) is now available for testing at
>         http://www.lua.org/work/lua-5.4.0-work2.tar.gz
>

Congratulations! Is there a test pack yet?

Thanks and Regards
Dibyendu




--
"A arrogância é a arma dos fracos."

===========================
Me. Italo Moreira Campelo Maia
Co-fundador do Grupo de Usuários Python do Ceará
Secretário ForHacker (fb.com/ForHackerSpace)
Desenvolvedor Full-Stack, Escritor, Empresário, Visionário
-----------------------------------------------------
Meu Livro, Site, Blog
===========================
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.4.0 (work2) now available

Tobias Kieslich
In reply to this post by Luiz Henrique de Figueiredo

Quoting Luiz Henrique de Figueiredo <[hidden email]>:

> The focus of Lua 5.4.0 is performance. We're especially interested in
> feedback about its performance but all feedback is welcome. Thanks.
> --lhf

I have silly little piece of code I use to compare language performance.
Includes I/O and arrays(table in Lua obviously). When called with 20
iterations Lua 5.4 runs 5.8s vs 7.8s in Lua 5.3. That's quite a
significant performance jump! That is looking awesome!


Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.4.0 (work2) now available

Tobias Kieslich

Quoting [hidden email]:

> Quoting Luiz Henrique de Figueiredo <[hidden email]>:
>
>> The focus of Lua 5.4.0 is performance. We're especially interested in
>> feedback about its performance but all feedback is welcome. Thanks.
>> --lhf
>
> I have silly little piece of code I use to compare language performance.
> Includes I/O and arrays(table in Lua obviously). When called with 20
> iterations Lua 5.4 runs 5.8s vs 7.8s in Lua 5.3. That's quite a
> significant performance jump! That is looking awesome!

Here is the code, in case someone is wondering:

#!/usr/bin/env lua

-- based on code by Erik Wrenholt

local BAILOUT        = 16
local MAX_ITERATIONS = 1000
local RESOLUTION     = 40
local RESFLOAT       = 40 / 1.0
local RESLOW         = 1-RESOLUTION
local RESHGH         = RESOLUTION-2
local write, clock, format = io.write, os.clock, string.format


local iterate = function( x, y )
        local cr = y-0.5
        local zi = 0.0
        local zr = 0.0

        for i = 0, MAX_ITERATIONS do
                local tmp = zr * zi
                local zr2 = zr * zr
                local zi2 = zi * zi
                zr = zr2  - zi2  + cr
                zi = tmp + tmp + x
                --print(zr,zi)
                if (zi2+zr2 > BAILOUT) then
                        return ' '
                end
        end
        return '*'
end

local mandelbrot = function( n )
        while n>0 do
                for y = RESLOW, RESHGH do
                        local output = { }
                        for x = RESLOW, RESHGH do
                                output[ x+RESOLUTION ] = iterate( x/RESFLOAT, y/RESFLOAT )
                        end
                        print( table.concat( output, '' ) );
                end
                n = n-1
        end
end

local n = 1
if arg[1] then
        n = tonumber( arg[ 1 ] )
end

local t = clock()
mandelbrot( n )
print( format( "Lua Time Elapsed %.2f", clock() - t ) )



Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.4.0 (work2) now available

Luiz Henrique de Figueiredo
In reply to this post by Tobias Kieslich
> I have silly little piece of code I use to compare language performance.
> Includes I/O and arrays(table in Lua obviously). When called with 20
> iterations Lua 5.4 runs 5.8s vs 7.8s in Lua 5.3. That's quite a
> significant performance jump! That is looking awesome!

Thanks for the feedback.

If you're curious, check out the new VM instructions with luac -l.
BTW, we also welcome feedback on luac. We may have missed something
when listing the new VM instructions.

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.4.0 (work2) now available

Roberto Ierusalimschy
In reply to this post by Dibyendu Majumdar
> On 18 June 2018 at 21:33, Luiz Henrique de Figueiredo
> <[hidden email]> wrote:
> > Lua 5.4.0 (work2) is now available for testing at
> >         http://www.lua.org/work/lua-5.4.0-work2.tar.gz
> >
>
> Congratulations! Is there a test pack yet?

It should be available soon (today or tomorrow).

-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.4.0 (work2) now available

Roberto Ierusalimschy
In reply to this post by Luiz Henrique de Figueiredo
> The focus of Lua 5.4.0 is performance. We're especially interested in
> feedback about its performance but all feedback is welcome. Thanks.
> --lhf

In particular, we are interested in how our jump table implementation
behave in different platforms. It seems to hurt performance in some
systems. You can turn them on/off defining the flag LUA_USE_JUMPTABLE
to 1 or 0. The default is 1 when __GNUC__ is defined. Also, in some
systems you may get better performance with jump tables by turning
off some compiler optimizations, such as crossjumping.

-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.4.0 (work2) now available

Luiz Henrique de Figueiredo
In reply to this post by Dibyendu Majumdar
A test suite is available at
        http://www.lua.org/work/lua-5.4.0-w2-tests.tar.gz

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.4.0 (work2) now available

Dibyendu Majumdar
On 19 June 2018 at 13:52, Luiz Henrique de Figueiredo
<[hidden email]> wrote:
> A test suite is available at
>         http://www.lua.org/work/lua-5.4.0-w2-tests.tar.gz
>

Thank you. I see various occurrences of undef in the tests - is that
intentional?

Regards
Dibyendu

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.4.0 (work2) now available

Roberto Ierusalimschy
> Thank you. I see various occurrences of undef in the tests - is that
> intentional?

Yes. As I said, I've found useful to use undef (which is equal to nil)
as a way to document that I am removing an element from a table.

-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.4.0 (work2) now available

Dibyendu Majumdar
On 19 June 2018 at 22:06, Roberto Ierusalimschy <[hidden email]> wrote:
>> Thank you. I see various occurrences of undef in the tests - is that
>> intentional?
>
> Yes. As I said, I've found useful to use undef (which is equal to nil)
> as a way to document that I am removing an element from a table.
>

Okay.

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.4.0 (work2) now available

Dibyendu Majumdar
In reply to this post by Luiz Henrique de Figueiredo
On 18 June 2018 at 21:33, Luiz Henrique de Figueiredo
<[hidden email]> wrote:
> The focus of Lua 5.4.0 is performance. We're especially interested in
> feedback about its performance but all feedback is welcome. Thanks.

I am curious about the changes in how function calls/returns are
handled. Were the drivers for these changes performance related?

Thanks and Regards
Dibyendu

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.4.0 (work2) now available

Dibyendu Majumdar
In reply to this post by Luiz Henrique de Figueiredo
On 19 June 2018 at 02:09, Luiz Henrique de Figueiredo
<[hidden email]> wrote:
> If you're curious, check out the new VM instructions with luac -l.

While the improved performance of 5.4 is very welcome to everyone - I
do feel sad that there was a certain beauty in the minimalism of the
5.3 instruction set which is now lost. As always happens, performance
related changes introduce complexity (and in some ways ugliness) - as
I am only too aware because of the work in Ravi.

Can't be helped I suppose.

Regards
Dibyendu

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.4.0 (work2) now available

Roberto Ierusalimschy
In reply to this post by Dibyendu Majumdar
> I am curious about the changes in how function calls/returns are
> handled. Were the drivers for these changes performance related?

Yes.

-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.4.0 (work2) now available

Egor Skriptunoff-2
In reply to this post by Luiz Henrique de Figueiredo
On Tue, Jun 19, 2018 at 4:09 AM, Luiz Henrique de Figueiredo wrote:
BTW, we also welcome feedback on luac

I'm unable to build luac.exe
luac.obj : error LNK2005: luaP_opmodes already defined in lopcodes.obj
luac.exe : fatal error LNK1169: one or more multiply defined symbols found


And thanks for auto-randomseed!
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.4.0 (work2) now available

Luiz Henrique de Figueiredo
> I'm unable to build luac.exe
> luac.obj : error LNK2005: luaP_opmodes already defined in lopcodes.obj
> luac.exe : fatal error LNK1169: one or more multiply defined symbols found

Thanks for the report.

Why did the linker try to resolve symbols in lopcodes.obj since
presumably  luac.obj is listed before lua.lib?
How are you building luac.exe?

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.4.0 (work2) now available

Egor Skriptunoff-2
On Thu, Jun 21, 2018 at 12:43 AM, Luiz Henrique de Figueiredo <[hidden email]> wrote:
> I'm unable to build luac.exe
> luac.obj : error LNK2005: luaP_opmodes already defined in lopcodes.obj
> luac.exe : fatal error LNK1169: one or more multiply defined symbols found

Why did the linker try to resolve symbols in lopcodes.obj since
presumably  luac.obj is listed before lua.lib?
How are you building luac.exe?


I'm using script based on "etc/luavs.bat" to build Lua under Visual Studio command prompt.
It worked perfectly with all previous versions of Lua.
 
@setlocal
@set MYCOMPILE=cl /nologo /MD /O2 /W3 /c /D_CRT_SECURE_NO_DEPRECATE
@set MYLINK=link /nologo
cd src
%MYCOMPILE% /DLUA_BUILD_AS_DLL l*.c
del lua.obj luac.obj
%MYLINK% /DLL /out:lua54.dll l*.obj
%MYCOMPILE% /DLUA_BUILD_AS_DLL lua.c
%MYLINK% /out:lua.exe lua.obj lua54.lib
%MYCOMPILE% l*.c
del lua.obj linit.obj lbaselib.obj ldblib.obj liolib.obj lmathlib.obj loslib.obj ltablib.obj lstrlib.obj loadlib.obj
%MYLINK% /out:luac.exe *.obj
del *.obj
cd ..

 
Should I set the correct order of .obj files for linker invocation?
What is this order?

Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.4.0 (work2) now available

Xavier Wang


Egor Skriptunoff <[hidden email]>于2018年6月21日 周四下午1:16写道:
On Thu, Jun 21, 2018 at 12:43 AM, Luiz Henrique de Figueiredo <[hidden email]> wrote:
> I'm unable to build luac.exe
> luac.obj : error LNK2005: luaP_opmodes already defined in lopcodes.obj
> luac.exe : fatal error LNK1169: one or more multiply defined symbols found

Why did the linker try to resolve symbols in lopcodes.obj since
presumably  luac.obj is listed before lua.lib?
How are you building luac.exe?


I'm using script based on "etc/luavs.bat" to build Lua under Visual Studio command prompt.
It worked perfectly with all previous versions of Lua.
 
@setlocal
@set MYCOMPILE=cl /nologo /MD /O2 /W3 /c /D_CRT_SECURE_NO_DEPRECATE
@set MYLINK=link /nologo
cd src
%MYCOMPILE% /DLUA_BUILD_AS_DLL l*.c
del lua.obj luac.obj
%MYLINK% /DLL /out:lua54.dll l*.obj
%MYCOMPILE% /DLUA_BUILD_AS_DLL lua.c
%MYLINK% /out:lua.exe lua.obj lua54.lib
%MYCOMPILE% l*.c
del lua.obj linit.obj lbaselib.obj ldblib.obj liolib.obj lmathlib.obj loslib.obj ltablib.obj lstrlib.obj loadlib.obj
%MYLINK% /out:luac.exe *.obj
del *.obj
cd ..

 
Should I set the correct order of .obj files for linker invocation?
What is this order?

You should add lopcodes.obj to the “del” line
--
regards,
Xavier Wang.
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] Lua 5.4.0 (work2) now available

Luiz Henrique de Figueiredo
In reply to this post by Egor Skriptunoff-2
> %MYLINK% /out:luac.exe *.obj

I wonder why this is not as below, which was what I meant:

%MYLINK% /out:luac.exe luac.obj lua54.lib

Is it because lua54.lib is affected by /DLUA_BUILD_AS_DLL ? Indeed,
luac.exe needs to be statically linked.

Anyway, the luaP_opmodes glitch will be fixed for the final Lua 5.4.0
release. Thanks for the report.

1234