# wasm-linker: Intern globals, exports & imports · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/f5a31cb0d693ef3c07da7f446c95999cef34488b)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: f5a31cb0d693ef3c07da7f446c95999cef34488b

Requested commit: f5a31cb0d693ef3c07da7f446c95999cef34488b

Commit: f5a31cb0d693ef3c07da7f446c95999cef34488b

Tree: 8b4ea40e8a2d8240d0559ef9220ccd4c8fe9868b

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm-linker: Intern globals, exports & imports

Symbols that have globals used to have their lookup key be the symbol name.
This key is now the offset into the string table.

Imports have both the module name (library name) and name (of the symbol), those strings are now
also being interned. This can save us up to 24bytes per import which have both their module name and name de-duplicated.
Module names are almost entirely the same for all imports, providing us with a big chance of saving us 12 bytes at least.

Just like imports, exports can also have a seperate name than the internal symbol name. Rather than storing the slice,
we now store the offset of this string instead.

```

## Parents

- [b1159ab7aecfe704adcb4cf44d6fedafd572a720](https://git.cafe/gitcafe/zig/commit/b1159ab7aecfe704adcb4cf44d6fedafd572a720?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/f5a31cb0d693ef3c07da7f446c95999cef34488b?format=markdown)
