lua-users home
lua-l archive

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


> On 06/23/2018 05:24 AM, dyngeccetor8 wrote:
> > 5.4.0 version [...]
> > execution is really slower.
> 
> I've sketched artificial test to exploit slower (but economical)
> garbage collector and give a try for new random().
> 
> Can someone retest it?
> 
>     [...]
> local num_iterations = 1e8
> local table_width = 1e8
> 
> print(_VERSION)
> 
> math.randomseed(os.time())
> 
> local t = {}
> for i = 1, num_iterations do
>   local k = math.random(table_width)
>   t[k] = {}
> end

This is a particularly nasty example for Lua 5.4. It generates
little garbage (around 25% of the total memory used); and it is all
around one single big table, so nothing relevant ever becomes "old".
In fact, both 5.3 and 5.4 run faster if we turn off the collector,
without using significantly more memory. (But even then 5.4 is still
some 10% slower than 5.3. I will check that.)

As a consolation, luajit also does not perform particularly well
in this benchmark :-)  (only ~10% faster than 5.3). 

-- Roberto