Skip to content

Web: Refactor build script to run in parallel with full LTO #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 7, 2022

Conversation

akien-mga
Copy link
Member

Fabio found that full LTO produces smaller binaries than ThinLTO,
and that's quite important for the Web platform:

18M	sizes/full_lto_no_txt.wasm
3,5M	sizes/full_lto_no_txt.wasm.br
20M	sizes/full_lto.wasm
4,1M	sizes/full_lto.wasm.br
20M	sizes/thin_lto_no_txt.wasm
3,8M	sizes/thin_lto_no_txt.wasm.br
23M	sizes/thin_lto.wasm
4,5M	sizes/thin_lto.wasm.br

But for an obscure reason LLVM's full LTO cannot linking with multiple
threads, and so it's slow as heck (10-15 min per build).

So we work it around by starting all builds in parallel so that they
can all link at the same time.

The code to do so is pretty ugly, could be refactored further.

Fabio found that full LTO produces smaller binaries than ThinLTO,
and that's quite important for the Web platform.

But for an obscure reason LLVM's full LTO cannot linking with multiple
threads, and so it's slow as heck (10-15 min per build).

So we work it around by starting all builds in parallel so that they
can all link at the same time.

The code to do so is pretty ugly, could be refactored further.
@akien-mga akien-mga force-pushed the web-parallel-builds-full-lto branch from bfc7caf to f37caa7 Compare September 7, 2022 09:10
@akien-mga akien-mga merged commit 41f2a83 into main Sep 7, 2022
@akien-mga akien-mga deleted the web-parallel-builds-full-lto branch September 7, 2022 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant