lua-users home
lua-l archive

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


Some result on Windows, VC2010 compiler, running the same Lua source code:

size = print(collectgarbage"count") -- integer part
exe = 32 or 64 bits program executable.
no = not defined
yes = defined

size  exe   LUA_INT_INT   LUA_REAL_FLOAT  LUA_32BITS
----  ---   -----------   --------------  ----------
151   32    no            no              no
53    32    no            no              yes
123   64    no            no              no
123   64    no            no              yes
123   64    yes           yes             yes

So, it seems that the memory usage is (nicely) reduced only with a 32 bits
executable.


-----Message d'origine-----
De : lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] De la
part de Luiz Henrique de Figueiredo
Envoyé : vendredi 19 décembre 2014 12:48
À : Lua mailing list
Objet : Re: Performance development Lua 5.1 -> 5.3-rc

> Any application that has its own copy of Lua 5.3 should take into
> consideration the ideal size for lua_Number and for lua_Integer. All
> it takes is one single line in 'luaconf.h';

It's the explanation starting at `@@ LUA_INT_INT`.

You can choose one of each:
	#define LUA_INT_INT 
	#define LUA_INT_LONG 
	#define LUA_INT_LONGLONG

	#define LUA_REAL_FLOAT 
	#define LUA_REAL_DOUBLE 
	#define LUA_REAL_LONGDOUBLE

The default is 
	#define LUA_INT_LONGLONG
	#define LUA_REAL_DOUBLE

So, it's two lines :-)

But you can define LUA_32BITS to get 32-bit integers and 'float' and
LUA_C89_NUMBERS to get 'long' and 'double, which was the traditional
combination before 5.3.