mirror of
https://github.com/mileswolfallen2/gelectron.git
synced 2026-12-06 08:43:52 +00:00
make ram efficiency way better animated to read me And made a new benchmark
This commit is contained in:
1 parent
a11d5a1350
commit
c916883e14
82 files changed
+20646
-227
No files matched your search
+22
@@ -0,0 +1,22 @@
|
||||
// Copyright 2020-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
if (window.location.pathname.startsWith("/page2")) {
|
||||
console.log("hello from javascript in page2");
|
||||
} else {
|
||||
console.log("hello from javascript in page1");
|
||||
|
||||
if (typeof WebAssembly.instantiateStreaming !== "undefined") {
|
||||
WebAssembly.instantiateStreaming(fetch("/wasm.wasm")).then((wasm) => {
|
||||
console.log(wasm.instance.exports.main()); // should log 42
|
||||
});
|
||||
} else {
|
||||
// Older WKWebView may not support `WebAssembly.instantiateStreaming` yet.
|
||||
fetch("/wasm.wasm")
|
||||
.then((response) => response.arrayBuffer())
|
||||
.then((bytes) => WebAssembly.instantiate(bytes))
|
||||
.then((wasm) => {
|
||||
console.log(wasm.instance.exports.main()); // should log 42
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user