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
-- Hypothesis: allocating short-lived tables in a hot loop pressures the
-- mark-sweep GC. Useful baseline for "is GC the bottleneck?" questions.
-- Each iteration allocates a fresh 4-entry table and discards it.

function _bench()
    local sum = 0
    for i = 1, 500 do
        local t = { a = i, b = i + 1, c = i + 2, d = i + 3 }
        sum = sum + t.a + t.b + t.c + t.d
    end
    return sum
end

for i = 1, 1200 do _bench() end
print("alloc/short_tables: true")