diff options
| author | gbc dev <gbc@localhost> | 2026-09-22 20:48:09 +0200 |
|---|---|---|
| committer | gbc dev <gbc@localhost> | 2026-09-22 20:48:09 +0200 |
| commit | a2aa8fbb20cab296d44bcdd23c63c0f76ec52869 (patch) | |
| tree | 700f7a394f8bceb27199590343b158e872e1404d /tools | |
| parent | web: selecting a Game Boy puts the caret in its console (diff) | |
| download | sl0pboy-master.tar.gz sl0pboy-master.tar.xz sl0pboy-master.zip | |
zig defaults the wasm stack to 16MB, and that lands in the module's *initial*
memory, so every instance allocated 16.25MB before executing an instruction.
With several Game Boys on one page that was the dominant cost: 123MB for six.
The machine is a static and nothing here recurses deeply, so 256KB is plenty.
Per instance: 20.5MB -> 4.8MB of linear memory (six: 123MB -> 29MB). Note the
spelling - zig cc rejects -Wl,--stack-size and -zstack-size, and wants
-Wl,-z,stack-size=N.
With memory no longer the constraint, the page cap goes 6 -> 8 on measurement
rather than guesswork. Emulation-only, one thread: 12.5x realtime at 1, 3.1x
at 4, 1.5x at 8, and exactly 1.0x at 12 - i.e. ~12 is where a thread runs out
of road with nothing left for rendering. 8 holds a verified 60fps each in a
real browser with all eight leased.
Golden frames are still pixel-exact on cgb-acid2, dmg-acid2, cpu_instrs@600
and pky@400 with its .sav, and two Game Boys still lease and ping 4/4.
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions
