perf(marker): hak hvert sekund — ingen kopier når intet ændrer sig, passive marker i tiendedele, scan hvert 2. s, cachet markliste/markører, tick-tidsmåling i loggen (v1.27.1.0)

In-game 26/9: lille hak ca. hvert sekund. Markarbejdets tick kopierede alle markers data hvert sekund
(affald -> GC-pause), hentede alle kortets marker og alle AD-markører.
This commit is contained in:
2026-09-26 02:03:31 +02:00
parent 7a073ae047
commit c34a472b1c
8 changed files with 101 additions and 24 deletions
+12
View File
@@ -289,5 +289,17 @@ check("M22 ballesamling ikke vejrfølsom", M.isWeatherSensitive("baleCollecting"
check("M22 gemmes", M.fromRecord(M.toRecord(M.with(M.newField(4), {plan = {straw = "bale"}}))).plan.straw, "bale")
check("M22 ukendt -> hakkes", M.fromRecord({id = 5, straw = "x"}).plan.straw, "chop")
-- M23: ingen ny tabel når vækst-reglen ikke ændrer noget (undgår affald hvert sekund -> GC-hak)
local calm = M.newField(95)
check("M23 uændret -> samme tabel", M.onReadiness(calm, 0.2) == calm, true)
check("M23 ændret -> ny tabel", M.onReadiness(calm, 0.95) ~= calm, true)
-- M24: passive marker kan springes over (manuel, uden mål, venter, ingen forespørgsel)
check("M24 manuel venter = passiv", M.isPassive(calm), true)
check("M24 auto = ikke passiv", M.isPassive(M.with(calm, {plan = {mode = "auto"}})), false)
check("M24 mål = ikke passiv", M.isPassive(M.setTarget(calm, "WHEAT")), false)
check("M24 klar = ikke passiv", M.isPassive(M.with(calm, {stage = "ready"})), false)
check("M24 i gang = ikke passiv", M.isPassive(started), false)
check("M24 Start nu = ikke passiv", M.isPassive(M.with(calm, {startRequested = true})), false)
print(failures == 0 and "\nALLE TESTS OK" or ("\n" .. failures .. " FEJL"))
os.exit(failures == 0 and 0 or 1)