# wasm-linker: write to file at once · gitcafe/zig

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

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

Visibility: public

Requested revision: 6dbf5f1d8686c1f5b31f3dfce9b1ac0944f8e3a5

Requested commit: 6dbf5f1d8686c1f5b31f3dfce9b1ac0944f8e3a5

Commit: 6dbf5f1d8686c1f5b31f3dfce9b1ac0944f8e3a5

Tree: 47480b99b6c92dd133a177f60be140d47b4c1d56

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm-linker: write to file at once

Rather than writing to the file using a writer, we now first write to
an arraylist and store the binary in memory. Once the full binary
data was written, we write all data to disk at once. This reduces
the amount of syscalls tremendously, increasing the performance of
the linker in exchange for increased memory usage during flush.

```

## Parents

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

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