[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.4-work1 with first class arrays (implementation & benchmarks)
- From: Petri Häkkinen <petrih3@...>
- Date: Thu, 22 Mar 2018 21:17:42 +0200
On 22 Mar 2018, at 20.29, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>> Any feedback, critique, questions, comments etc. are welcome!
>
> I am particularly puzzled by this result:
>
>> Benchmark Unmodified Patched Patched
>> Tables Tables Arrays
>> Scatter-read 0.200s 0.208s 0.170s
>
> If I undestood correctly the code, the Patched Arrays implementation
> uses exactly the same code as Unmodified Tables for reads. Can you
> explain this difference?
Without diving deeper into it, I would guess that in this case some elements of the table go into the hash part (the data is sparse because of random access pattern in the benchmark). Look ups from the hash map is slower than reading from an array which is always stored linearly.
Petri