graphics.dat: archive handle in the bindings #431

Closed
opened 2026-10-30 17:38:21 +01:00 by jqueuniet · 0 comments
Owner

Each graphics* binding call takes the archive bytes and re-parses them. Through wasm-bindgen that copies the whole file (8.6 MB on DOS) into WASM memory per call: about 1 ms per image on a debug build, dominated by the copy. An asset browser decodes thousands.

Proposal

A GraphicsArchive class in the wasm binding (and the equivalent handle elsewhere), built once from the bytes, with the listing and decoders as methods. The free functions can stay as wrappers.

Acceptance

  • Decoding every DOS image through one handle is at least 5× faster than through the free functions.
Each `graphics*` binding call takes the archive bytes and re-parses them. Through wasm-bindgen that copies the whole file (8.6 MB on DOS) into WASM memory per call: about 1 ms per image on a debug build, dominated by the copy. An asset browser decodes thousands. ## Proposal A `GraphicsArchive` class in the wasm binding (and the equivalent handle elsewhere), built once from the bytes, with the listing and decoders as methods. The free functions can stay as wrappers. ## Acceptance - Decoding every DOS image through one handle is at least 5× faster than through the free functions.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jqueuniet/dm2-tools#431
No description provided.