Databank operations take a long time when the databank stores many keys.
The following script freezes the game for almost 2 minutes:
databank.clear()
local t_start = system.getTime()
for i = 1, 3000 do
databank.setIntValue(tostring(i), 0)
end
system.print(string.format("Total time: %.10f", system.getTime() - t_start))
Suggestions:
optimize databank operations to take less time
limit the max number of keys in a databank to less than 500
manually decrement the Lua instruction counter (hookcount of lua_State) in databank functions (to make the databank functions more "expesive" to call and have them trigger the CPU overload error)
Databank operations take a long time when the databank stores many keys.
The following script freezes the game for almost 2 minutes:
Suggestions:
hookcount
oflua_State
) in databank functions (to make the databank functions more "expesive" to call and have them trigger the CPU overload error)