mirror of
https://github.com/HeyPuter/gex.git
synced 2026-11-13 20:12:43 -10:00
wasmtime compiles a position-independent module's active element segment (at global.get __table_base) into its startup code, one table store per slot; a program's million slots took register allocation hours. A segment of over 16384 slots is now made passive and filled by one table.init at the head of the start function, in memory, for wasmtime's compile only: the cache keys and the shipped module are unchanged (V8 fills an active segment lazily, and a table.init eagerly). Measured, the rewrite compiles a 64k-slot segment in 1.2 s against 4.0 s. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_853378b774d645b4ac78b16d9af91a31