examples
examples copied to clipboard
Confused about performance
Hi there. I'm new to WebAssembly and AssemblyScript ... I was looking to speed up JavaScript code and started to play around with it.
So I had a question: I was playing with the Mandelbrot demo. What I did is, I ported the code from the ts file, directly to the js file ... so I can calculate the mandelbot set either by the code in the compiled webassembly - or directly within the javascript code. I expected the webassmbly calculation to be (significantly?) quicker.
But actually these are my results:
Using Chrome: JavaScript Code ~ 530ms ... WebAssembly ~ 1000ms Using Firefox: JavaScript Code ~ 580ms ... WebAssembly ~ 570ms ("limit" set to do 800 iterations. My PC is running windows, AMD Ryzen 9 3900X)
So it seems that in Chrome the WebAssembly version is half as fast as the normal JavaScript version ... in Firefox both version are at least equal in performance.
Is this expected? Or am I missing something?