On Wed, Mar 16, 2016 at 1:46 PM, Floh <[email protected]> wrote: > I have updated the Oryol samples page with WebAssembly versions built with > emscripten+binaryen (as described here, using the spidermonkify.py > post-link-pass: https://github.com/kripken/emscripten/wiki/WebAssembly > > The sample page is here: http://floooh.github.io/oryol/ > > For the wasm samples you need the latest Firefox Nightly or Chrome Canary, > and manually enable WebAssembly support via about:config or chrome://flags/. > > No code changes were necessary and everything was working out of the box > (at least once I figured out how compilation and conversion to the 'right' > wasm format works). > > A few nitpicks and questions: > > - the standard emscripten shell-html page for wasm causes a 'synchronous > XMLHttpRequest' warning on the JS console, and it seems to me that the > loading is indeed synchronous (the spinning loader I use for the asm.js > version didn't show up), is there a recommended way to properly load the > wasm module and all other initially needed files asynchronously? >
Yeah, we should optimize that. Right now when it falls back to asm.js, it does a sync xhr - this was just a quick hack. We should just do a normal xhr for the asm.js, if it's needed, and only load the main .js after that. The code is in emcc.py if anyone wants to write a PR. > > - not related, but I noticed that github-pages doesn't compress the .wasm > and .mem files, especially for the .wasm file this is bad since the missing > compressing undoes it's size- and loading-time advantage versus the asm.js > version. > > Hmm, I wonder if there is a way to tell github-pages that a file can be gzipped? I would hope it would do it automatically, but I guess it does it by suffix, and .wasm and .mem aren't recognized... > Since I can't reconfigure the server-side, I did a dirty trick and renamed > the files to .wasm.txt and .mem.txt (yeah I know...) which causes them to > be properly compressed. This probably is a (weak) argument for having > compression built right into the wasm format instead of relying on the web > server to compress, compression is absolutely critical for wasm files, but > sometimes the web server configuration is off-limits. > > All minor stuff of course, all in all I'm extremely impressed how well the > whole thing already works :) > > 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]. > 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.
