Skip to content

Latest commit

 

History

History
25 lines (15 loc) · 1.23 KB

File metadata and controls

25 lines (15 loc) · 1.23 KB

Web Workers & WASM Example

Comparision of three ways of handling computationally expensive procedures. In this example we're basing on no optimized recursive algorithm for calculating n-th Fibonacci number. While doing this computation in standard way for "big" numbers (greater than 40) the whole UI is blocked and not responsive. On the other hand by using Web Worker we're able to run this computation in the background. As a result the UI is fully responsive. Additionaly we're also using function written in Rust and compiled to WASM. Again, for the quite "big" numbers time of computation is far better for WASM code instead of JS.

Demo

Demo is available here. CI/CD has been configured to automatically deploy any changes using firebase CLI.

Build & Run 👷

Local

yarn build:wasm
yarn install
yarn start

Docker

Type docker-compose up -d and then navigate to http://localhost:8080/.

Unit Tests ⚠️

UTs are failing because of problem with imported WASM function.