dellingr 0.1.0

An embeddable, pure-Rust Lua VM with precise instruction-cost accounting
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-- ipairs iteration kernel.
-- Prebuilds one dense array, then sums it through the Rust-backed ipairs iterator.

local arr = {}
for i = 1, 10000 do
    arr[i] = i
end

function _bench()
    local sum = 0
    for _, v in ipairs(arr) do
        sum = sum + v
    end
    return sum
end

for i = 1, 200 do _bench() end
print("iter/ipairs: true")