Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lanesawyer/wasm-canvas-test
https://github.com/lanesawyer/wasm-canvas-test
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lanesawyer/wasm-canvas-test
- Owner: lanesawyer
- Created: 2022-07-31T03:50:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-31T03:54:38.000Z (over 2 years ago)
- Last Synced: 2024-04-20T08:45:54.946Z (8 months ago)
- Language: Rust
- Size: 66.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WASM Canvas Test
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!
## How to Test
1. Run `trunk build` to get a `dist` folder
2. Run `npx simple-server dist` to serve the WASM code folder
3. Run `npx simple-server .` to serve the JS items
4. Pull up each page
5. Open the network tab
6. Refresh and compare!