Skip to content

Instantly share code, notes, and snippets.

@Sapu94
Sapu94 / TableCountTest.lua
Created October 12, 2025 15:11
Testing the performance of the new table.count() API in 11.2.5
function TableCountTest()
local function RunTest(numValues, countFunc)
local t = {}
for i = 1, numValues do
t["key_"..i] = i
end
assert(countFunc(t) == numValues)
local numLoops = 10000
local startTime = debugprofilestop()
for _ = 1, numLoops do