Rust (WebAssembly) is slower than JavaScript

We are trying to speed up JavaScript code using Rust (WebAssembly). The code is as follows, but it is noticeably slower than the equivalent JavaScript code. I had hoped that Rust (WebAssembly) would be faster, but am I missing something (e.g. compiler options)? #[wasm_bindgen] pub unsafe fn subtra…