A great article on profiling and optimising a JavaScript program in order to match the performance of its rewrite in Rust/WebAssembly.
It’s a long but readable exploration of replacing certain bits of code and modifying algorithms in JavaScript to unlock a four-fold improvement in performance.