You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did a cross-compilation of Rust code to wasm and embedded into my Go application. After compiling my Go application with env GOOS=js & GOARCH=wasm and executing in browser environment, much slower performance is observed compared to my local environment.
Description
Please find the complete source code here: demo.zip
demo.go - ImageRs.Convert() resizes an image by calling exported function in wasm using the runtime.
This is part of SDK which is cross-compiled for use in few platforms including web. Due to limited support for the required functionality in Go, SDK uses wasm compiled from rust library and wazero runtime.
It seems like I'm complicating. Is there an alternate way that would work?
Statement
I did a cross-compilation of Rust code to wasm and embedded into my Go application. After compiling my Go application with env
GOOS=js
&GOARCH=wasm
and executing in browser environment, much slower performance is observed compared to my local environment.Description
Please find the complete source code here: demo.zip
ImageRs.Convert()
resizes an image by calling exported function in wasm using the runtime.demo.wasm
is produced on executingCGO_ENABLED=0 GOOS=js GOARCH=wasm go build -o demo.wasm .
in root folder of the project.On opening
demo.html
instantiatesdemo.wasm
.Screenshots
Benchmark shows it takes less than a second to execute in my local env while it takes minutes in browser environment.
Environment (please complete the relevant information):
The text was updated successfully, but these errors were encountered: