WebAssembly / WebAssembly/binaryen

Investigate why `wasm-merge` + `wasm-opt` output is larger than the corresponding monolithic module processed with `wasm-opt`

Open
#8,910 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
WebAssembly
Stars
8.6k
Forks
885
Avg merge
1d 19h
Merged PRs (30d)
69

Description

Recently, we experimented with applying wasm-merge and wasm-split to a Compose Multiplatform application using different Kotlin compilation modes as input. More detailed results are available here.

The results most relevant to this issue are:

  • Original Opt × Monolith: 6,159,539 bytes
  • Merged Opt × Closed World: 6,589,864 bytes

As shown above, the second binary is larger. It would be useful to investigate the reasons for this difference and suggest possible improvements on both on Binaryen and Kotlin sides.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported size comparison with wasm-merge, wasm-split, and wasm-opt using the Compose Multiplatform inputs described in KT-86859. Compare the optimized monolithic and merged binaries to identify the causes of the size difference; done means documenting the causes and proposing improvements for Binaryen or Kotlin.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin, wasm
Domain
compilers, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.