wasmpack

command
v1.162.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Command wasmpack shrinks a Go js/wasm binary after linking.

On wasm the linker gives every function 64 KiB of PC space, so runtime.findfunctab holds 320 bytes per function: sixteen buckets, each the function's index followed by sixteen zero bytes. wasmpack removes that table from the data section and adds a start function that writes it back at instantiation. It then re-splits the remaining data around runs of zeroes, which the linker stops doing once the table has used up its segment budget.

The table is found by its content and only removed when the start function reproduces it byte for byte, so memory after instantiation is unchanged. A module without such a table is left as it is.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL