This project researches the difference between JavaScript and WebAssembly implementations. Initially, I was trying to use WebAssembly to speed up the calculation of the Fibonacci sequence. However, the first WebAssembly implementation was slower than the JavaScript implementation. The first WebAssembly implementation took an integer input and returned a string output. I suspected the string conversion was slowing the code. Initially, I didn't have a JS implementation to compare against, but when I implemented JS version and compared the two, I found that the JS version was faster by a factor of 3. I improved the WebAssembly implementation to return a JS BigInt and the performance improved, however, it is still on par (and very slightly slower) with the JS version. This is likely because calculating the Nth Fibonacci number is a very simple operation that the JS engine can easily optimize for.
See the source code for the WebAssembly section here for more details (here is the original implementation that outputted a string).
WARNING: Large numbers may slow/crash the page.