wasm-opt is a WebAssembly binary optimizer for shrinking embedded UDFs and improving their execution performance inside database environments. section 5.3.2
Its optimization work includes:
- Removing unused code from the binary. section 5.3.2
- Simplifying control flow. section 5.3.2
- Making memory usage more efficient. section 5.3.2
Optimizing a database UDF
Compile a WebAssembly function, optimize its binary with wasm-opt, convert the resulting binary to hexadecimal, and embed it in SQL as a LANGUAGE wasm function such as encrypt or decrypt. The optimized blob can reduce the SQL artifact’s size and improve execution. section 5.3.2 section 5.5
