I have seen a nice video which was talking about performance of web-assembly, but running your example
the javascript is playing with similar speed, but on the graph it has been shown that the wasm is -97% is faster than javascript.
https://youtu.be/6v4E6oksar0?t=1796
my green line is showing 2.3, and my blue line is showing 400-500