merge ws/arch2-cab (archive/cab; codecs/compress/Lzx, Quantum; Deflate preset dictionary + mszip)

This commit is contained in:
4DBug committed 2026-10-31 16:27:11 -05:00
commit 3e83879a6e
15 files changed
+2267 -5

No files matched your search

+27 -1
View File
@@ -2,7 +2,7 @@
-- Fixtures: tools/fixtures/deflate.py (a 6 MB corpus), tools/fixtures/png.py (1024 x 768 images), tools/fixtures/mp3.py,
-- tools/fixtures/opus.py (3 s stereo files; MB/s of f32 output, 48 kHz stereo f32 is 0.384 MB/s of real time),
-- tools/fixtures/flac.py; wav encodes / decodes a generated tone; zstd / brotli / bzip2 / lzma / lz4 (*_bench corpora), .Z (tools/fixtures/z.py), fonts
-- (glyphs per second), json / xml / yaml, jpeg / gif / tiff / qoi / tga / pnm / hdr and ImageOps.
-- (glyphs per second), cab (LZX / MSZIP / Quantum), json / xml / yaml, jpeg / gif / tiff / qoi / tga / pnm / hdr and ImageOps.
local Deflate = require("@formats/codecs/compress/Deflate")
local Crc32 = require("@formats/core/Crc32")
local Bytes = require("@formats/core/Bytes")
@@ -1190,6 +1190,32 @@ do
end
end
end
-- ws-arch2 cabinets: LZX (codecs/compress/Lzx), Quantum (codecs/compress/Quantum) and MSZIP folders of
-- tools/fixtures/cab.py (MB/s of output; each run decodes the cabinet again, so the folder cache does not count)
do
local Cab = require("@formats/archive/cab")
local CF = require("@tests/gen/cab")
for _, kind in { "lzx", "quantum", "mszip" } do
local datas, total = {}, 0
for _, c in CF.cases do
local a = Cab.decode(Bytes.reader(buffer.fromstring(c.data))) :: any
if a and a.meta.folders[1].method == kind and #c.data > 20000 then
table.insert(datas, buffer.fromstring(c.data))
for _, e in a:list() do
total += e.size
end
end
end
bench("cab " .. kind .. " (" .. #datas .. " cabinets)", 5, total, function()
for _, d in datas do
local a = Cab.decode(Bytes.reader(d)) :: any
for _, e in a:list() do
a:read(e.name)
end
end
end)
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.