Hi

I am trying to use the Wasm Snapshot to reduce the startup time, and it 
succeeded. Wasm Apps run correctly, reducing startup time by 20-50%.

My job is to help developers export Unity games to webgl mode to run on our 
App (WeChat in China). 
Unfortunately, after exports, wasm callMain is very slow, taking an average 
of 5 seconds.

So I spent a few months experimenting with the Wasm Snapshot solution, 
which means, take a snapshot of Wasm App during development. 
At runtime, callMain is no longer executed, but a snapshot.data is 
downloaded and restored. The snapshot.data includes Wasm Memory, FS, GL, 
and other JS States.
At the same time, I will cut out the data in wasm and some resources of 
Unity's res-bundle, because they are no longer needed.

In the 5 Unity games tested, no problems were found. Startup time-consuming 
optimization is considerable.

The snapshot.data size is about 4MB after compression(brotli). 
The optimization is about 2-5sec (20%-50%). See the end for specific data.

Wasm Snapshot is an awesome solution, and I want you to know that it really 
works.
At the same time, I would like to know whether the startup is a common 
problem? And can it be used as a new feature of Emscripten to benefit more 
users?

[image: 截屏2022-12-22 17.34.57.png]

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/cdaeda97-f40f-42ac-8194-2bb771d49aebn%40googlegroups.com.

Reply via email to