-
Notifications
You must be signed in to change notification settings - Fork 58
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
New nightly shows mysterious changes of binary size #214
Comments
The suspect is upgrade to LLVM 7.0: rust-lang/rust#51966 |
Hm, so maybe wasm-opt just introduces noise here? In the example above, I use If I try to use If I completely remove wasm-opt from the picture, I still get the same picture: smaller file with old toolchain with 30% garbage. The absolute file size is slightly bigger though. |
This is likely due to new debuginfo sections, but if you reinstall wasm-bindgen-cli it'll automatically remove them in non-debug mode. Does that account for the increase in size? |
I've just tried wasm-bindgen[-cli] from master, and I still get 574k after wasm-opt. |
Here's another experiment, sans wasm-opt this time:
|
And, to further rule-out debug symbols hypothesis, adding |
Aside: we should really get wasm code size into https://perf.rust-lang.org/ -- @alexcrichton do you know who I would talk to about that? |
I'm trying to drill into what's going on here and it definitely seems like it's static data related, although I can't quite figure out how. I've been able to roughly reproduce the numbers that @matklad is getting, although not exactly. I may be using a different version of In any case I first tried
Interpreting this looks like 21k bytes were added. Each pair of code outputs is pretty similar, and I'm assumign that these roughly match up to the same function in both executables (the symbols are tweaked slightly). The "code" segments, however, are all over the place. It looks like LLVM 7 took the one massive data chunk and split it up into a lot of little pieces (which I think makes sense?). Somehow though 21k got added on, and I'm not sure how to account for that. It's worth remembering though that we started passing the Overall I'm not sure where the other 16k came from. I'd probably just chalk it up to "LLVM changed thousands of lines of code" and something got lost in the middle. |
@fitzgen I believe simulacrum is the one you want to ping for that! (or perhaps rust-lang/rustc-perf#145) |
Turns out I've initially misinterpreted results of That is, |
Having looked at all the garbage, twiggy reports that approx 78% of the file is garbage (for both rustc versions). That does not sound reasonable at all, and I suspect that maybe its twiggy's bug? |
Almost certainly, yeah. Without relocations, we can't precisely know which data segments are truly used where, which is a big source of blindness. |
My WASM binary went from 101kb to 1.4Mb. Gloups :-).(https://github.com/Hywan/gutenberg-parser-rs) |
Here are some insights:
|
Note: Tested with the latest I've updated So… 101kb to 16kb. Nothing to say :-). |
I think the time for debugging this has since passed, so closing. |
For https://github.com/matklad/tom/tree/f81bede5244eda62dac6b362784b6529d17f26e6, I observe an interesting difference between nightly-2018-07-07 and nightly-2018-07-13.
On 07-07, I see a huge unused data section in WASM. On 07-13 the section is gone, but the total size of the binary is nonetheless slightly bigger. This is after wasm-opt (see build.sh)
STR:
The text was updated successfully, but these errors were encountered: