Nick
02/18/2024, 7:35 AMRobert Jaros
02/18/2024, 7:59 PMNick
02/19/2024, 5:06 PMRobert Jaros
02/19/2024, 5:15 PMbashor
02/19/2024, 9:48 PMNick
02/19/2024, 9:52 PMbashor
02/19/2024, 10:14 PMbashor
02/19/2024, 10:14 PMbinaryenArgs
?Nick
02/19/2024, 10:14 PMNick
02/19/2024, 10:16 PMbashor
02/19/2024, 10:17 PMbashor
02/19/2024, 10:18 PMapplyBinaryen()
or applyBinaryen { }
should be enough in the most casesbashor
02/19/2024, 10:19 PMbashor
02/19/2024, 10:22 PM--closed-world
we don’t apply it now because it will not work for compose apps where we have 2 wasm binariesNick
02/19/2024, 10:23 PMbashor
02/19/2024, 10:28 PMbashor
02/19/2024, 10:29 PMbashor
02/19/2024, 10:36 PMlet counter = 0;
let sum = 0;
let time = performance.now();
let fpsIndicator;
function updateFps() {
window.requestAnimationFrame((newTime) => {
counter++;
if ((newTime - time) > 1000) {
fpsIndicator.textContent = counter;
time = newTime;
counter = 0;
}
updateFps();
});
}
fpsIndicator = document.createElement("div");
fpsIndicator.style = "position: fixed; right: 0; top: 0; width: 30px; z-index:1000; background-color: #FFF;"
document.body.appendChild(fpsIndicator)
updateFps();
bashor
02/19/2024, 10:38 PMNick
02/19/2024, 10:38 PMNick
02/20/2024, 12:28 AMapplyBinaryen()
in the example apps, that otherwise works fine w/o it. i hit an unreachable condition that doesn't happy w/o the optimizations:
Uncaught (in promise) RuntimeError: unreachable
at doodle-tutorials-TimedCardsRunner-wasm-js.wasm:0xcf06d
at doodle-tutorials-TimedCardsRunner-wasm-js.wasm:0xcf091
at doodle-tutorials-TimedCardsRunner-wasm-js.wasm:0xd9980
at doodle-tutorials-TimedCardsRunner-wasm-js.wasm:0xcfd31
at doodle-tutorials-TimedCardsRunner-wasm-js.wasm:0xce9ed
at doodle-tutorials-TimedCardsRunner-wasm-js.wasm:0xcea6b
at doodle-tutorials-TimedCardsRunner-wasm-js.wasm:0xae4e5
at doodle-tutorials-TimedCardsRunner-wasm-js.wasm:0xae698
at doodle-tutorials-TimedCardsRunner-wasm-js.wasm:0xdb364
at doodle-tutorials-TimedCardsRunner-wasm-js.wasm:0xa07d1
the the apps are in the same repo. and the change is to simply use applyBinaryen()
w/o any conditional here.
if (executable) {
binaries.executable()
applyBinaryen()
// if (project.gradle.startParameter.taskNames.find { it.contains("wasmJsBrowserProductionWebpack") } != null) {
// applyBinaryen {
// binaryenArgs = mutableListOf(
// "--enable-nontrapping-float-to-int",
// "--enable-gc",
// "--enable-reference-types",
// "--enable-exception-handling",
// "--enable-bulk-memory",
// "--inline-functions-with-loops",
// "--traps-never-happen",
// "--fast-math",
// "--closed-world",
// "--metrics",
// "-O3", "--gufa", "--metrics",
// "-O3", "--gufa", "--metrics",
// "-O3", "--gufa", "--metrics",
// )
// }
// }
}
not sure if i'm doing something wrong.
the last call from the main js file before hitting the error can be seen in this image.Nick
02/20/2024, 12:35 AMbashor
02/20/2024, 12:59 AMbashor
02/20/2024, 1:00 AMbashor
02/20/2024, 1:05 AMunreachable
bashor
02/20/2024, 1:05 AMapplyBinaryen {
binaryenArgs += "-g"
}
Nick
02/26/2024, 4:55 AM