Selecting the right loading strategy is a complex topic and highly depends 
on your app's needs and limitations (most importantly if your high level 
code can be restructured for asynchronous IO), even if you can't rewrite 
everything for async IO you can workaround this by having 'loading phases' 
which populate an in-memory-filesystem, similar to what emscripten's 
filesystem wrapper does, but without the big upfront download.

 I've done a few presentations in the past which might be helpful:

- http://www.slideshare.net/andreweissflog3/gdce2013-cpp-ontheweb (see 
slides 25..27)
- http://www.slideshare.net/andreweissflog3/quovadis2013-cpp-ontheweb 
(slides 27..28)
- not emscripten specific, but describes an on-demand-streaming 'http 
filesystem': 
http://www.slideshare.net/andreweissflog3/data-management-and-streaming-strategies-in-drakensang-online
 
(slides 13..17)

You can also have a look at my weekend-engine which implements a very 
simplified version of the HTTP filesystem described above (without 
table-of-content-files and MD5-hashes):

https://github.com/floooh/oryol/tree/master/code/Modules/HTTP

the emscripten-specific parts are here:

https://github.com/floooh/oryol/blob/master/code/Modules/HTTP/emsc/emscURLLoader.cc

Cheers,
-Floh

Am Dienstag, 27. Oktober 2015 19:47:27 UTC+1 schrieb ZengRui Wang:
>
> Hi
> Currently, for each application of our project, we preload the data 
> actually needed and before the main js execution we use something like 
> <script async type="text/javascript" 
> src="../data/data-chrmaarten-default-motions.js"></script> to request the 
> data.
> But we are trying to build a platform that all the application could be 
> run on it which mean we need to preload all the data for each application 
> (about 400 MB) which seems a big workload at the startup. I search online 
> and there are several options like
>
>
> https://hacks.mozilla.org/2015/02/synchronous-execution-and-filesystem-access-in-emscripten/
> https://github.com/kripken/emscripten/issues/2047
> https://github.com/kripken/emscripten/issues/416
>
> What is the best way to do the dynamic data loading?
> Thanks!
>
>

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