That is very surprising, yeah. Enabling the emterpreter should only reduce asm.js size by moving functions into the binary bitcode file, but unless your main is 40MB, that can't explain this ;)
Emterpreter mode does change a few optimizations, which in theory could affect code size. It enables localCSE for example which is off by default. But also I wouldn't expect a huge change. Is there perhaps an obvious difference, like one of the files has whitespace and the other doesn't? (which would be a bug in emscripten) If not, you can run python tools/find_bigfuncs.py on the js files, that prints a list of functions by size, maybe some obvious difference will appear there. On Tue, Dec 27, 2016 at 3:03 PM, <[email protected]> wrote: > Hi, > > in the first version of our Emscripten port we used the Emterpreter in > order to replace our synchronous downloads using emscripten_wget_data(). > In the meanwhile we wanted to get rid of the Emterpreter and refactored > our codebase to support asynchronous downloads, but we realized that > suddenly the code size (.asm.js file) increased a lot. > > As a workaround we added the flags "-s EMTERPRETIFY=1 -s > EMTERPRETIFY_WHITELIST='[\"_main\"]'", which basically only passes the > main function to the emterpreter. > This reduced our asm.js file from 59 MB to 18 MB. > > I would not expect such a huge difference... I would be very happy to hear > your opinions? > The only explanation I would have is that the emterpreter disables some > heavy inlining, but still I think it is quite a lot. Moreover, as far as I > understood the emterpreter post-processes the generated asm.js code, so it > should only affect the code size of our main function, right? > > Any ideas in which direction I could further investigate? > Is it possible to generate a list of symbols, which I could use for > generating a diff from both version? Maybe this might help me to find out > more about the additional 40 MB code.... > > Thanks in advance, > Harald > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
