Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confused about performance #28

Open
GitHobi opened this issue Dec 2, 2022 · 0 comments
Open

Confused about performance #28

GitHobi opened this issue Dec 2, 2022 · 0 comments

Comments

@GitHobi
Copy link

GitHobi commented Dec 2, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant