-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
asm.js output size increase after update to latest incoming #5049
Comments
Worth pointing out that I have chunkification explicitly disabled so I could investigate #5031. It was working fine until I updated about 4 days of incoming commits, including llvm 4 etc. So nobody else is likely to see this failure, but I still want to figure out why it's happening since it could affect my final output size. |
When you re-enable chunkification, does it work? Either way still interesting to know why code size changed here, but it could just be libc is a little bigger, and happened to cross a node.js limit. |
Yeah, with chunkification works (hence "nobody else is likely to see this failure"). |
My command:
This is basically a ton of link flags plus I tested two versions of emscripten. When I refer to 'incoming-x' below, I mean incoming as of Friday (df8796f) which contains llvm 4. Both of the tests were run on identical bitcode files (generated by incoming-x) and since there weren't any errors I assume that's fine.
That's a pretty gigantic difference :( @kripken do you have an interest in getting to the bottom of this? If so, what would be helpful for stripping it down for you? e.g. if I can come up with a reduced test case that's 5MB with the old llvm and has an extra ~40% overhead with the new llvm, is that useful? In the worst case I can just share everything with you (code/bitcode/whatever), but I'm reasonably set up for being able to reduce at the moment so could save some time. |
Yeah, that seems larger than a small libc change... very odd. First thing I would do is make a build with whitespace and function names (e.g. with If nothing shows up there, then the next candidate are the function tables, especially with |
I did the easy step first (removing flags) out of laziness. Results: For 1.37.6 (140MB):
For incoming-x (217MB):
Surprised that exceptions are such a big deal, but no other hints here. I'll investigate function sizes next. |
I compared the two files after removing all three of the flags mentioned in the previous comment:
Looks like the new llvm is leaving far more functions around. One of the functions I checked at random never has its address taken so seems like it should be eliminated. Another one does have its address taken, so I don't know how the old llvm was eliminating it. I'm going to do a full rebuild of all deps with the old llvm so I'm not running it on bitcode generated by the new llvm as I want to double check the above. |
Did this and the sizes are now within 1MB of each other. I assume I hadn't disabled chunks on the old llvm, and then I was misled by llvm 4.0 bitcode being accepted but then being badly mistreated by llvm 3.9. Closing as a PEBCAK. I'll contribute back my |
i.e. it's failing in https://github.com/kripken/emscripten/blob/142adaf/tools/js-optimizer.js#L66-L69
See nodejs/node#3175
Something must be generating larger code so the js-optimizer is failing to read it all in (this is in the second phase of optimizer passes before emterpretifying, see the bullet points in #5046, so
asmPreciseF32 asm eliminate simplifyExpressions emitJSON
have been run), but the input code to this second phase is 371MB so clearly this is much bigger than it was when it worked before (since the size then must have been 250MB or below)!I'll investigate later, just wanted to report the issue
The text was updated successfully, but these errors were encountered: