[PATCH] D41315: [WebAssembly] Output functions individually

Nicholas Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 18 10:52:14 PST 2017

ncw added a comment.

I've just been doing some testing, to evaluate the filesize from Wasm LLD.

I have here a binary that's part of our HTML5 product (the VNC Connect SDK, which includes an asm.js blob).

- In asm.js uncompressed, unminified, the output is 12684717 (13MB), gzips to 2138009 (2.1MB)
- LLD's current output is 1611558 (1.6MB)! Hooray.
- Of current output, 50695 (50KB) is duplicated string data. Tiny actually! Calculated as difference between `strings` and `strings | sort -u` output.
- Of current output, 87179 (85KB) is data from functions that are provided in multiple translation units (ie inline functions - where we can avoid outputting the duplicate copies). This was calculated with some hacky extra logging on my COMDAT branch.
- Current output gzips to 465671 (450KB)

So, we're actually pretty small already, at least compared to asm.js from Emscripten. Pruning some duplicate data would be nice, but (to me) it's lower-priority than essential functionality, considering the output is surprisingly competitive with asm.js already.

The next steps for me are to continue debugging the Comdat support to the point where our full app runs successfully.

  rLLD LLVM Linker


More information about the llvm-commits mailing list