[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, 29 Mar 2018 21:04:20 +0300
On 29 Mar 2018, at 13.01, Duane Leslie <parakleta@darkreality.org> wrote:
>
> They do have different semantics, but I believe you can implement everything you've proposed directly in Lua with equivalent performance (some small constant overhead for the VM) except maybe for the resize function.
“Equivalent performance”? “Small constant overhead"? Please.
Here are the relevant benchmarks using regular Lua tables, your Lua emulated arrays (with bugs fixed) and native arrays:
Running benchmarks using tables...
Insert 0.390144s
Push 2.439730s
Length 2.207718s
Running benchmarks using Lua emulated arrays...
Insert 2.492200s
Push 3.522455s
Length 0.643619s
Running benchmarks using native arrays...
Insert 0.313242s
Push 0.436351s
Length 0.134404s
Petri