News for hackers. Stuff that matters.
Re:Simple diet tricks for asm.js by hackcasual on Saturday August 27, 2016 @02:43PM (#12373579)
The ELIMINATE_DUPLICATE_FUNCTIONS support was contributed by Tableau Software, by the team I'm on. It's quite expensive processing wise, but is worth a shot seeing if your code base benefits from it. Our usecase leverages a lot of shared pointer based templated classes, which tends to create a lot of delete functions that boil down to free(this);

2 other points I'd add to this overall:

1) Can't emphasize enough how bad exception support is for size, expect in the neighborhood of 30% size increase. This is due to needing to handle all of the possible ways functions can return. Even with exception support disabled, you can still throw them, you just can't catch them in C++ land.

2) goto's. There's a few good reasons to use these, especially in code that needs to make sure cleanup code always runs. Emscripten supports that with a couple different code constructs, pretty much all of which cause a significant amount of bloat. We've saved ~100k in some cases by specifically targeting some 3rd party code that made use of them and rewritting them to not have gotos.

Re:Simple diet tricks for asm.js by vmorgulis on Saturday August 27, 2016 @04:24PM (#12374008)
> Even with exception support disabled, you can still throw them, you just can't catch them in C++ land.

Is something printed in the console under emscripten if an exception is thrown?

Re:Simple diet tricks for asm.js by hackcasual on Saturday August 27, 2016 @04:53PM (#12374124)
It gets converted into a Javascript exception, which will at least give you the Emscripten converted function it was thrown in.
Re:Simple diet tricks for asm.js by vmorgulis on Sunday August 28, 2016 @05:39AM (#12375928)
Interesting. Thank you.