feat(perf): indbygget profiler — måler alle indgange (hooks, update, GUI), logger top-6 pr. minut ved > 2 ms

This commit is contained in:
2026-09-26 11:19:35 +02:00
parent 0fca6e8a9a
commit 8a18187103
4 changed files with 169 additions and 0 deletions
+5
View File
@@ -1184,11 +1184,16 @@ function ADSmartPickup:loadMap()
end
function ADSmartPickup:update(dt)
if ADProfiler ~= nil and ADProfiler.installed then
local now = ADProfiler.clock()
if now ~= nil then pcall(ADProfiler.frame, now) end
end
if not isHooked then
local adEnv = getAutoDriveEnv()
if adEnv ~= nil and g_currentMission ~= nil and g_currentMission.storageSystem ~= nil then
installHook(adEnv)
isHooked = true
if ADProfiler ~= nil then pcall(ADProfiler.install) end
if ADRunsController ~= nil then
pcall(ADRunsController.load, adEnv)
pcall(ADRunsController.installSaveHook)