From 93adbe71264f8a4569ae106ebb13b60c0ec931bf Mon Sep 17 00:00:00 2001 From: Mizar Date: Sun, 8 May 2022 23:35:49 +0900 Subject: [PATCH 1/2] - prefetch wasmBinary --- script/wasm_build.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/wasm_build.js b/script/wasm_build.js index 541aa3e53..3db5c7dc5 100755 --- a/script/wasm_build.js +++ b/script/wasm_build.js @@ -149,7 +149,8 @@ async function runRepl(yaneuraou) { } async function main(argv) { - const yaneuraou = await YaneuraOu(); + const wasmBinary = await fs.promises.readFile(path.join(__dirname, "./lib/yaneuraou.${pkgobj.name}.wasm")); + const yaneuraou = await YaneuraOu({ wasmBinary }); const FS = yaneuraou.FS; if (USI_BOOK_FILE) { const buffer = await fs.promises.readFile(USI_BOOK_FILE); @@ -203,7 +204,8 @@ async function runRepl(yaneuraou: YaneuraOuModule) { } async function main(argv: string[]) { - const yaneuraou: YaneuraOuModule = await YaneuraOu(); + const wasmBinary = await fs.promises.readFile(path.join(__dirname, "./lib/yaneuraou.${pkgobj.name}.wasm")); + const yaneuraou: YaneuraOuModule = await YaneuraOu({ wasmBinary }); const FS = yaneuraou.FS; if (USI_BOOK_FILE) { const buffer = await fs.promises.readFile(USI_BOOK_FILE); From c39139c8c3d525eda12fb7b50a8651d07eb8292a Mon Sep 17 00:00:00 2001 From: Mizar Date: Mon, 9 May 2022 16:43:49 +0900 Subject: [PATCH 2/2] - wasm: Makefile tune --- source/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Makefile b/source/Makefile index 9a3b5f188..1d20b3fbf 100644 --- a/source/Makefile +++ b/source/Makefile @@ -189,7 +189,7 @@ else LDFLAGS += -s ALLOW_MEMORY_GROWTH=1 -s INITIAL_MEMORY=$(EM_INITIAL_MEMORY_SIZE) -s MAXIMUM_MEMORY=4294967296 LDFLAGS += -s TOTAL_STACK=67108864 LDFLAGS += -s LLD_REPORT_UNDEFINED - LDFLAGS += -s PROXY_TO_PTHREAD + # LDFLAGS += -s PROXY_TO_PTHREAD # LDFLAGS += -s ALLOW_UNIMPLEMENTED_SYSCALLS # LDFLAGS += -s ASSERTIONS LDFLAGS += -s --closure 1