I played around with the separate memory init file and was surprised to see 
that it does, in fact, increase the total code size. In fact, the numbers I 
got are:

* JS with inline memory initialization: 23186642 bytes
* JS and separate memory init file:  15250276+8988744 = 24239020 bytes

That's a bit surprising to me as I would expect the binary memory init file 
to spend one byte per, well, byte in HEAP8. Also, the inline memory 
initializer is a plain JS array, which is unecessarily large (each value 
takes at least 1-3 bytes per byte plus 1 byte for the comma). If the 
initial memory values were encoded as an UTF-8 string (and at runtime 
retrieved using String.charCodeAt), there were 1-2 bytes per "entry" (=byte 
on the heap), only (on average if memory init values are uniformly 
distributed: 1.5 bytes). Of course, that would produce non-printable 
characters in the generated JS file. Not sure if all JS interpreters would 
like that. If no, base64 (or basE91 for less overhead - see 
http://base91.sourceforge.net/), would still use up less space in the JS 
file. 

If noone objects, I would work on implementing the latter.

Soeren

-- 
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.

Reply via email to