I have recently been using Emscripten for building some personal projects 
as a test, but have noted some various issues.
version = 1.35.0

slow compilation times:
* compiling takes a fairly long time if compared with native compilers, 
such as MSVC or GCC.
* ex: when compiling a 200 kLOC program, compilation takes a decent number 
of minutes.
** program is most a basic Minecraft-style 3D engine (voxel-based).
** it isn't that big, and MSVC (VS2015) compiles it in under a minute.
* can note: optimized JS output is about 8MB, vs ~ 60MB without 
optimizations.

general requests: maybe try to make compile times faster?


WASM: tool heap sizes too small
* if trying to compile to WASM, the tools blow up with the 64MB heap.
* increasing the heap size to 512MB or so in "wasmator.py" seems to fix the 
issue.
* ( seems to produce an approx 2 MB WASM file. )

misc:
* compiler seems to be imposing some C++ rules onto C for some reason.
* this can be addressed, but it was annoying needing to go over and stick 
in extra type-casts on pointers and similar.

also more/better debugging facilities would be nice, even if only something 
like making "emrun" able to provide a GDB style interface.


misc issues noted with APIs:
* libdl / dlsym doesn't seem to work
** example use-case is fetching function pointers for various functions 
within the codebase.
** broken dlsym required manually writing tables to map names to function 
pointers.
* for normal Windows, these decls' use "__declspec(dllexport)" and 
"GetProcAddress()".

issues with the OpenGL emulation:
* VBO's don't seem to work for some reason (I just get garbage geometry)
* glVertexAttribPointer and friends don't seem to work
** they seem to expect VBO's, but as noted already, the VBOs don't seem to 
work
* glUniformMatrix4fv doesn't appear to work
* glEnable(GL_ALPHA_TEST); does not give alpha testing with fixed-function 
(can be emulated in shaders though).
* only seem to get one working glDrawArrays or glDrawElements call per VBO 
or vertex-array.
** no idea why this would be.
* glTexParameterf and similar can't update integer parameters (generally 
works on desktop GL)
* texture filtering options don't work correctly
** some textures which should be drawn using mipmapped nearest filtering 
are drawn using trilinear.
* in some cases, code within the GL wrapper seems to give "type error" and 
"value must be an integer" type exceptions.
* ...

granted, yes, there are disclaimers about the quality of the OpenGL 
emulation.


nothing here that really derails the project, and overall will admit that 
it is working better than I was initially expecting (in the sense that the 
compiled program is "basically usable" in a browser, and has generally 
passable performance, though does seem to still fall a bit short of native 
speeds).


have observed that rendering and input-handling seem faster on Chrome, 
whereas primarily CPU-based tasks seem faster on Firefox (but offset by it 
being noticeably slower to respond to keys being pressed/released than in 
Chrome). general start-up times are a lot faster in Chrome.

however, I keep getting "browser ran out of memory" type error messages 
(primarily in Chrome, which basically says something like "Aw, Snap! 
Browser ran out of memory while trying to display website.") after a period 
of time (~ 15-20 minutes), this being seemingly uneffected by the choice of 
a 256MB or 512MB heap size (note: 256MB is about the minimum I can get away 
with, with a 64-meter draw distance; in native land for a 256 meter 
draw-distance memory use is generally around 1 GB, ...).


thoughts/comments?...


for anyone curious, I have a built version online from here:
https://cr88192.github.io/bgbtech_html/

I haven't pushed the changes for all this back up to GitHub yet, but 
general source for the engine is here:
https://github.com/cr88192/bgbtech_engine2

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