This is a small experiment to compare the differences in speed between WASM and JS when drawing items on a canvas
.
On my personal machine, I was getting the full WASM page to load in about 250 ms, while the JS one was around 290 ms. Not a huge difference, and maybe I have subtle differences in the code that I'm not seeing, but I was surprised WASM beat it!
- Run
trunk build
to get adist
folder - Run
npx simple-server dist
to serve the WASM code folder - Run
npx simple-server .
to serve the JS items - Pull up each page
- Open the network tab
- Refresh and compare!