# WXWebAssembly
WXWebAssembly is similar to the Web standard WebAssembly, and can improve the performance of Weixin Mini Program to some extent.
Starting with the base library v2.13.0, Weixin Mini Program can access and use WXWebAssembly objects globally.
Starting with the base library v2.15.0, Weixin Mini Program supports the use of WXWebAssembly within Workers.
# WXWebAssembly.instantiate(path, imports)
Similar to the standard WebAssembly.instantiate, except that the first argument accepts only one **** package path of type **, which points to the.wasm file within the package
# Similarities and Differences with WebAssembly
- WXWebAssembly.instantiate (path, imports) method, path is the path inside the code package (.wasm and.wasm.br suffixes supported)
- Supports WXWebAssembly.Memory
- Support for WXWebAssembly.Table
- Support WXWebAssembly.Global
- Export supports functions, Memory, Table, iOS platform does not support Global
# Other Notes
- Documentation on WebAssembly can refer to https://webassembly.org/
- Some WXWebAssembly features have been added since the base library v2.14.0
- The package path allows you to pass in brotli compressed wasm files such as
.wasm.br - Added support for WXWebAssembly.Global
- The package path allows you to pass in brotli compressed wasm files such as
- Weixin Mini Program Plugin supports WXWebAssembly from base library v2.18.1
- When using WXWebAssembly within a worker, the.wasm file needs to be placed outside the worker directory, because the worker directory will only package.js files and non-.js files will be ignored
- SIMD features supported from WeChat 8.0.25
# Q&A
- Compiled out of. Wasm volume is too large, more than the code package volume limit how to do?
- Method 1: Split a wasm file into multiple wasm files, and then use the subpackage loading capacity to reduce the volume of the first package
- Method 2: Compress wasm files using brotli