>  however I expected at least equal to or better performance than JS.

Hi,

Unfortunately, this expectation is incorrect. Wasm is NOT guaranteed to 
give you better or at least equal performance to javascript. This is even 
in the general case when you run wasm using emcc. The performance is very 
dependant on what you are running and on which browser (sometimes even 
browser versions matter). 

Take a look at this to see how does the performance vary 
- https://takahirox.github.io/WebAssembly-benchmark/.

Coming to Go, 1.11 will just have experimental support. We are just 
focusing on correctness as of now. Also, there are couple of issues in the 
wasm spec itself which impediments a language like Go which needs to unwind 
and restore the call stack when switching between goroutines. This is only 
related to Go though. But even in the general case, wasm performance is not 
always better than javascript. WebAssembly is not a silver bullet.

-Agniva

On Friday, 10 August 2018 15:58:01 UTC+5:30, netbrain wrote:
>
> So been playing around with go and wasm support on go version devel 
> +479da24aac Fri Aug 10 00:47:31 2018 +0000 linux/amd64
>
> Curious on performance i tried implementing a Fibonacci algorithm function 
> in JS and compared it to it's equivalent in GO. Calculating fib(44) takes 
> 11 seconds on my machine in JS and in GO it takes 36 seconds.
>
> Any idea's to why I would get these results? I know wasm is very much an 
> experimental feature of go, however I expected at least equal to or better 
> performance than JS. Are there any browser optimizations which is running 
> in my JS code which may not be in effect in wasm?
>
> Test code available at 
> https://github.com/netbrain/kata/tree/master/go/wasm
>
> Cheers
> Kim
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to