Wasm streaming compilation and gzip

916 views
Skip to first unread message

Bugra Barin

unread,
Jan 25, 2018, 12:35:24 PM1/25/18
to emscripten-discuss
Hi all,

We currently gzip our wasm files which shrinks them from 8MB to 2.5MB. Now, with Firefox 58 supporting streaming wasm compilation, I am wondering if this gzipping would be an impediment.

Also, we were setting the gzipped name of the wasm file via Module['wasmBinaryFile'] in 1.37.20 and that would let us load .wasm.gz file.

But with version 1.37.29, this seems ineffective and it tries to load the original unzipped .wasm file name. I wonder if that's a known change. This may be moot anyway if gzipping the wasm file is something we shouldn't be doing anyway.

Bugra

Alon Zakai

unread,
Jan 29, 2018, 2:28:34 PM1/29/18
to emscripten-discuss
Normally you should just enable gzip on your webserver, and it will send it in compressed form (if the browser supports that, which should be all of them these days). That will work with browsers that support streaming wasm compilation automatically.

If you also need to customize the URL where the wasm is, you can use the locateFile API,


(I believe the wasmBinaryFile option has been deprecated, as it was redundant with locateFile).

--
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 emscripten-discuss+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bugra Barin

unread,
Feb 1, 2018, 11:22:21 AM2/1/18
to emscripten-discuss
Great thanks Alon. I didn't realize wasmBinaryFile was deprecated.

On the gzip, I just didn't know if that would interfere with the streaming compilation. Thanks again for the confirmation.
Reply all
Reply to author
Forward
0 new messages