diff --git a/tools/bench.luau b/tools/bench.luau index c44889a..62aca5e 100644 --- a/tools/bench.luau +++ b/tools/bench.luau @@ -1258,6 +1258,27 @@ do Wad.map(w, "MAP01", { textures = false }) end) end +do + -- id Tech text (ws-idtech): Freedoom MAP01 as a UDMF TEXTMAP (tools/fixtures/udmf.py) parsed to tables and built + -- into a Scene, a Doom 3 .proc (tools/fixtures/proc.py) to a Scene; MB/s of text + local DoomMap = require("@rosetta/codecs/model/DoomMap") + local Udmf = require("@rosetta/model/udmf") + local Proc = require("@rosetta/model/proc") + local UD = require("@tests/gen/udmf") + local PR = require("@tests/gen/proc") + bench("udmf MAP01 TEXTMAP -> tables", 3, #UD.text, function() + DoomMap.udmf(UD.text) + end) + local ub = buffer.fromstring(UD.text) + bench("udmf MAP01 TEXTMAP -> Scene", 3, #UD.text, function() + Udmf.decode(Bytes.reader(ub)) + end) + local big = PR.doom3.text + local pb = buffer.fromstring(big) + bench("proc (" .. #big .. " B) -> Scene", 20, #big, function() + Proc.decode(Bytes.reader(pb)) + end) +end do -- Draco (codecs/model/Draco): the Stanford bunny (35k points, 69k faces, Edgebreaker valence, normals) and a UV -- sphere with seams; MB/s of decoded output (u32 indices + f32 attributes per point), plus triangles per second.