I'll try to have a closer look soon. I think for small demos, and especially WebAssembly, it makes sense to focus on the JS wrapper libraries (src/library_*.js), with the biggest one being library_gl.js. I wonder if there's still some 'untapped potential' there. But I haven't had a close enough look yet to make qualified statements ;)
The most interesting thing with a size of around 30..50 KByte is IMHO that it suddenly becomes a valid option to add emscripten-generated code as little 'snippets' into webpages (like what http://acko.net/ does). Cheers! Am Dienstag, 18. Juli 2017 12:10:47 UTC+2 schrieb jj: > > Neat! > > We do quite often have conversations about "scaling small", i.e. how > to make minimal output from Emscripten to be as lightweight in the > runtime as possible. If you do find opportunities that we could either > automatically dead code eliminate, or manually DCE by adding some > flags like -s NO_FILESYSTEM=1, feel free to raise bug reports. Scaling > small will help also developers who are getting started to understand > how Emscripten and WebAssembly works. > > 2017-07-18 10:00 GMT+03:00 Floh <[email protected] <javascript:>>: > > Hi, > > > > I have started a new 3D API wrapper experiment called Sokol, this time > as a > > pure C header-only lib, it mixes ideas from my Oryol C++ framework, and > the > > (still unfinished) Altai Typescript lib (see here: > > http://floooh.github.io/2016/10/24/altai.html). > > > > The (still very rough) github repo is here: > https://github.com/floooh/sokol > > > > Sample code is separate: https://github.com/floooh/sokol-samples > > > > Especially the results for emscripten are very encouraging, a triangle > > sample compiles down to 35 KByte gzipped asm.js, compared to 99 KByte > for > > Oryol (I still need to find out where the difference is coming from, > since I > > also took a lot of care about size reduction in Oryol, so far I know > that it > > is *not* malloc or printf (printf just seems to add about 2 KByte). > > > > The results for WebAssembly are also very interested (all gzipped): the > wasm > > blob is 8.3 KByte, and the accompanying JS code 21 KByte. I wish the JS > code > > would be smaller, but it's all small enough that I won't complain to > loudly > > ;) > > > > I expect that the sizes will grow a little bit since the GL backend > isn't > > complete yet, but not by much (I guess in the single-digit KByte area). > > > > The emscripten source code for the triangle sample is here (API details > may > > change of course). > > > > > https://github.com/floooh/sokol-samples/blob/master/html5/triangle-emsc.c > > > > And for comparison here's the same for GLFW+flextGL: > > https://github.com/floooh/sokol-samples/blob/master/glfw/triangle-glfw.c > > > > When the project has advanced far enough, I'm going to replace the > low-level > > parts of Oryol with the Sokol headers. > > > > Cheers! > > -Floh. > > > > -- > > 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] <javascript:>. > > 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.
