dellingr 0.2.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
-- Numeric indexing kernel.
-- Same dense array shape as iter/ipairs.lua, but traversed with a numeric for loop.

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

function _bench()
    local sum = 0
    for i = 1, 10000 do
        sum = sum + arr[i]
    end
    return sum
end

for i = 1, 250 do _bench() end
print("tables/numeric_index: true")