Facing initialisation delays when using SINGLE_FILE flag #19746
Replies: 5 comments 7 replies
-
If I understand you correctly you are saying the fetch promise takes 50-60s seconds to resolve, but the getBinary() promise resolves much quick, but that they both achieve the same end result? I wonder why the fetch method takes so long in comparison? |
Beta Was this translation helpful? Give feedback.
-
What version of emscripten are you using? |
Beta Was this translation helpful? Give feedback.
-
Any suggestions would be appreciated. |
Beta Was this translation helpful? Give feedback.
-
Adding a message to get focus of community on this ticker. |
Beta Was this translation helpful? Give feedback.
-
Hi Guys, |
Beta Was this translation helpful? Give feedback.
-
Hi Team,
Intro : I am using ZXing-CPP's WASM wrapper in one of my project. It uses Emscripten + CMake to generate the .js and .wasm files. Due to some limitation my project doesn't support a separate wasm file due to which I had to add the SINGLE_FILE flag in CMake flags list.
Issue : This workaround works fine and solves the limitation but introduces almost 50-60 sec delay during the initialisation where getBinaryPromise() method in the generated js file makes a fetch() command on the wasmBinaryFile variable which is (after using SINGLE_FILE) a base64 string of almost 1.2 million characters.
Workaround : Now, to fix this bug for the time-being I am modifying the code in generated file to just this:
Query : With this post I just wanted to seek advice from other experts around and ask if there is any other graceful way to fix this so that I do not need to modify the generated files ?
Beta Was this translation helpful? Give feedback.
All reactions