[refactor] build optimisation
There are many opportunities for optimization, this is a placeholder to find time to test options hoping the size can be reduced more.
https://emscripten.org/docs/optimizing/Optimizing-Code.html
for eg. here, we can bypass legalization (which can be costly) by using a new api. https://v8.dev/features/wasm-bigint