lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Could be possible to add one.tar.gz (amalgamation) to the default lua 5.4 packages?

Reason: amalgamated compilation usually shows an improved performance.

*Example*: the code I showed in the other thread "teste_gc.lua" [1] with standard and one.tar.gz from lua 5.3 (extra) [2], and generational gc.

time ./lua5.4 teste_gc.lua
524309.6
596331.1

real    1m8.585s
user    1m8.437s
sys    0m0.152s

time ./one/lua5.4 teste_gc.lua
524309.6
596331.1

real    1m7.345s
user    1m7.167s
sys    0m0.160s

Then, we have some improvement in performance!

------------------------------------

Feedback on compile flags:

Updated Makefile with (this is only for appreciation, I don't know about compilers)

-march=native -O3

, using

gcc version 7.2.0 (Ubuntu 7.2.0-8ubuntu3.2)

---------------------------

time ./lua5.4 teste_gc.lua
524309.6
596331.1

real    1m4.422s
user    1m4.252s
sys    0m0.168s


time ./one/lua5.4 teste_gc.lua
524309.6
596331.1

real    1m3.200s
user    1m3.054s
sys    0m0.148s

One.tar.gz is also faster but the general improvement is also considerable even using the standard procedure.

Many thanks!

[1] http://lua-users.org/lists/lua-l/2018-03/msg00398.html
[2] https://www.lua.org/extras/5.3/

p.s. there are some warnings when compiling one.tar.gz:

In file included from one.c:84:0:
../lvm.c: In function ‘luaV_execute’:
../lvm.c:884:5: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
 #if LUA_USE_JUMPTABLE
     ^~~~~~~~~~~~~~~~~
In file included from one.c:73:0:
../lgc.c: In function ‘reallymarkobject’:
../lgc.c:297:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
     case LUA_TUSERDATA: {
                         ^
../lgc.c:306:5: note: here
     case LUA_TLCL: case LUA_TCCL: case LUA_TTABLE:
     ^~~~
In file included from ../lcode.h:12:0,
                 from ../lcode.c:19,
                 from one.c:67:
../lcode.c: In function ‘luaK_finish’:
../lopcodes.h:108:30: warning: this statement may fall through [-Wimplicit-fallthrough=]
 #define SET_OPCODE(i,o) ((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \
                         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ((cast(Instruction, o)<<POS_OP)&MASK1(SIZE_OP,POS_OP))))
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../lcode.c:1698:9: note: in expansion of macro ‘SET_OPCODE’
         SET_OPCODE(*pc, OP_RETURN);
         ^~~~~~~~~~
In file included from one.c:67:0:
../lcode.c:1701:7: note: here
       case OP_RETURN: case OP_TAILCALL: {
       ^~~~
gcc -std=gnu99 -o lua  -march=native -O3 -Wall -Wextra -DLUA_USE_LINUX  -I.. -DMAKE_LUA  one.c   -lm -Wl,-E -ldl
In file included from one.c:84:0:
../lvm.c: In function ‘luaV_execute’:
../lvm.c:884:5: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
 #if LUA_USE_JUMPTABLE
     ^~~~~~~~~~~~~~~~~
In file included from one.c:73:0:
../lgc.c: In function ‘reallymarkobject’:
../lgc.c:297:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
     case LUA_TUSERDATA: {
                         ^
../lgc.c:306:5: note: here
     case LUA_TLCL: case LUA_TCCL: case LUA_TTABLE:
     ^~~~
In file included from ../lcode.h:12:0,
                 from ../lcode.c:19,
                 from one.c:67:
../lcode.c: In function ‘luaK_finish’:
../lopcodes.h:108:30: warning: this statement may fall through [-Wimplicit-fallthrough=]
 #define SET_OPCODE(i,o) ((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \
                         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ((cast(Instruction, o)<<POS_OP)&MASK1(SIZE_OP,POS_OP))))
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../lcode.c:1698:9: note: in expansion of macro ‘SET_OPCODE’
         SET_OPCODE(*pc, OP_RETURN);
         ^~~~~~~~~~
In file included from one.c:67:0:
../lcode.c:1701:7: note: here
       case OP_RETURN: case OP_TAILCALL: {
       ^~~~
gcc -std=gnu99 -o luac -march=native -O3 -Wall -Wextra -DLUA_USE_LINUX  -I.. -DMAKE_LUAC one.c   -lm -Wl,-E -ldl
In file included from one.c:84:0:
../lvm.c: In function ‘luaV_execute’:
../lvm.c:884:5: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
 #if LUA_USE_JUMPTABLE
     ^~~~~~~~~~~~~~~~~
In file included from one.c:73:0:
../lgc.c: In function ‘reallymarkobject’:
../lgc.c:297:25: warning: this statement may fall through [-Wimplicit-fallthrough=]
     case LUA_TUSERDATA: {
                         ^
../lgc.c:306:5: note: here
     case LUA_TLCL: case LUA_TCCL: case LUA_TTABLE:
     ^~~~
In file included from ../lcode.h:12:0,
                 from ../lcode.c:19,
                 from one.c:67:
../lcode.c: In function ‘luaK_finish’:
../lopcodes.h:108:30: warning: this statement may fall through [-Wimplicit-fallthrough=]
 #define SET_OPCODE(i,o) ((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \
                         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ((cast(Instruction, o)<<POS_OP)&MASK1(SIZE_OP,POS_OP))))
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../lcode.c:1698:9: note: in expansion of macro ‘SET_OPCODE’
         SET_OPCODE(*pc, OP_RETURN);
         ^~~~~~~~~~
In file included from one.c:67:0:
../lcode.c:1701:7: note: here
       case OP_RETURN: case OP_TAILCALL: {
       ^~~~