-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Custom Rust Targets for Shared Wasm Libraries #4683
Use Custom Rust Targets for Shared Wasm Libraries #4683
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I won't pretend to know what is going one but this seems like a nice cleanup removing musl from the classical compiler. Shame the instruction counts seem to go up.
test/bench/ok/bignum.drun-run.ok
Outdated
ingress Completed: Reply: 0x4449444c0000 | ||
debug.print: {cycles = 105_771_809; size = +1_817_872} | ||
debug.print: {cycles = 111_509_014; size = +1_817_872} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why this has increased so much?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I need to analyze why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I analyzed it and the problem is that the Rust/LLVM builtin memcpy
is way slower than musl
, not using 64-bit copying. I activated bulk memory copying to get better performance.
(Bignum needs a lot of memcpy
because of big integer reallocations to larger blobs.)
Simplify Motoko RTS building:
emscripten
or explicit compilation via LLVM IR.musl
(until now, it was only used for classical persistence).memcpy
of Rust is slower thanmusl
.wasm-ld
fix as the custom targets do not generate corresponding DSO-local relative table index relocations ([lld][WebAssembly] Fix relocation of Wasm table index with GOT access llvm/llvm-project#104043).