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 is available here. CI/CD has been configured to automatically deploy any changes using firebase CLI.
yarn build:wasm
yarn install
yarn start
Type docker-compose up -d
and then navigate to http://localhost:8080/
.
UTs are failing because of problem with imported WASM function.