lua-users home
lua-l archive

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


> On 18 Mar 2018, at 17.46, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> 
>> Well, I took a stab at it myself for some Sunday fun. It’s still very much work in progress, but the initial results seem promising.
>> 
>> Here are some benchmarking results for a large number of table reads/writes vs. array reads/writes.
>> 
>> [...]
> 
> Among other problems, your implementation slows down table access,
> because every access first has to check whether the value is an array. A
> fairer comparison would be of your implementation with tables against
> tables in an unmodified Lua source. (Another caveat is that you are
> testing accesses to constant indices, which is not the usual way arrays
> are used.)
> 
> -- Roberto
> 

Ok, thanks for the feedback! I’ll try to come up with a more realistic benchmark and improve the implementation. To be fair, array vs. table speed difference should be negligible unless the data set is larger and the hash part is larger than in this crude & simple benchmark.

Petri