Closed yowl closed 6 months ago
This PR adds -s WASM_BIGINT to the linking step for emscripten (not wasi where we link without emscripten and without javascript support so this doesn't apply). https://emscripten.org/docs/optimizing/Optimizing-Code.html?highlight=wasm_bigint
-s WASM_BIGINT
Bigint is widely supported now in browsers : https://caniuse.com/bigint
Rough measurements for HelloWasm using powershell
Measure-Command {start-process "C:/github/emsdk/upstream/emscripten/emcc.bat" -argumentList "@C:\github\runtimelab\artifacts\tests\coreclr/obj/browser.wasm.Debug/Managed/nativeaot\SmokeTests\HelloWasm\HelloWasm\native\link.rsp --js-library C:\github\runtimelab\src\tests\nativeaot\SmokeTests\HelloWasm\dotnet_support.js --pre-js C:\github\runtimelab\src\tests\nativeaot\SmokeTests\HelloWasm\Microsoft.JSInterop.js --pre-js C:\github\runtimelab\src\tests\nativeaot\SmokeTests\HelloWasm\shell.js --post-js C:\github\runtimelab\src\tests\nativeaot\SmokeTests\HelloWasm\HelloWasm.js" -Wait}
And the equivalent for the release build.
Debug Current : 23191 ms WIth Bigint: 2035 ms
Release: Current: 6086 ms With Bigint: 2028 ms
This improvement, as I understand it, is due to the fact that legalizing i64 is an expensive operation which we naturally avoid enabling BIGINT.
This PR adds
-s WASM_BIGINT
to the linking step for emscripten (not wasi where we link without emscripten and without javascript support so this doesn't apply). https://emscripten.org/docs/optimizing/Optimizing-Code.html?highlight=wasm_bigintBigint is widely supported now in browsers : https://caniuse.com/bigint
Rough measurements for HelloWasm using powershell
And the equivalent for the release build.
Debug Current : 23191 ms WIth Bigint: 2035 ms
Release: Current: 6086 ms With Bigint: 2028 ms
This improvement, as I understand it, is due to the fact that legalizing i64 is an expensive operation which we naturally avoid enabling BIGINT.