Open oatgnauh opened 1 month ago
And I also notice that __wasm_call_ctors
cost more time in dynamic link
non-dynamic link
dynamic link
While there could be some savings to be had here, dynamic linking does comes at a cost, just like it does on native platforms.
While there could be some savings to be had here, dynamic linking does comes at a cost, just like it does on native platforms.
Is there any suggested optimization direction? Thank you
While there could be some savings to be had here, dynamic linking does comes at a cost, just like it does on native platforms.
Is there any suggested optimization direction? Thank you
One improvement would be if we were to fix https://github.com/emscripten-core/emscripten/issues/12682. However, its not a simple change. Requires a fair amount refactoring.
Version of emscripten/emsdk:
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.54 (48216dc455f2ac2670ec4f8a32f293b62a730080) clang version 19.0.0git (https://github.com/llvm/llvm-project e769fb8699e3fa8e40623764f7713bfc783b0330) Target: wasm32-unknown-emscripten Thread model: posix InstalledDir: /home/compiler/emsdk/upstream/bin
Full link command and output with
-v
appended:for some reason, I have to split the origin
main.wasm
tomain.wasm
+side.wasm
. And using-s USE_PTHREADS=1
for mutilthread.createModule
From the phenomenon point of view, the dynamic link version is slower than the non-dynamic link version by 200ms+ in the createModule process. dynamiclink:
normal(non-dynamic link):
in my analyse, these mainly because of
LDSO.init(); loadDylibs();
, for load-time linking,parsing dynamic lib and exportting symbols mapstart thread
At the same time, dynamic linking is 200ms+ slower than normal when each thread starts. I guess this is partly because each thread needs to synchronize function symbols from the main thread.
compare to non-dynamic link:
Since these performance degradations are caused by the dynamic link mechanism, it is difficult for users to optimize it. Please give me some feasible suggestions. Thank you.