diff --git a/pages/runtime/cli.mdx b/pages/runtime/cli.mdx index 65ae1a1..52690e5 100644 --- a/pages/runtime/cli.mdx +++ b/pages/runtime/cli.mdx @@ -45,6 +45,16 @@ wasmer run my_program.wasm --singlepass > You can also use `--cranelift` or `--llvm` instead of `--singlepass`. +#### Run a Wasm file with LLVM thread control + +When using the LLVM compiler, you can control how many threads are used during compilation: + +```bash copy +wasmer run my_program.wasm --llvm --llvm-num-threads=4 +``` + +> If the requested number of threads is 1, then rayon is not used during compilation, and modules are compiled on the calling thread. + ### Run a WASI or WASIX Module You can pass the arguments that will be given to the WASI program: @@ -62,7 +72,7 @@ wasmer run my_wasi_program.wasm --env MYVAR=MYVALUE -- arg1 arg2 arg3 ## Help -This is the help output from the Wasmer CLI for `wasmer run --help` (last updated 2025-01): +This is the help output from the Wasmer CLI for `wasmer run --help` (last updated 2025-04): ``` Run a WebAssembly file or Wasmer container @@ -130,6 +140,11 @@ Options: --llvm Use LLVM compiler + --llvm-num-threads + Only available for the LLVM compiler. Sets the number of threads used to compile the input module(s). + + If set to 1, compilation happens on the calling thread without using rayon. + --enable-verifier Enable compiler internal verification. diff --git a/pages/runtime/features.mdx b/pages/runtime/features.mdx index 7310616..53dfe91 100644 --- a/pages/runtime/features.mdx +++ b/pages/runtime/features.mdx @@ -31,6 +31,7 @@ Each of this backends support different features, and have different support for ### Wasmer features - **Caching**: compiled WebAssembly modules can be reused so subsequent runs of a Wasm file will have very little start up time; - **Metering**: computation time and other resources can be monitored and limits set to control how the Wasm code runs. This is also known as "gas metering"; + - **LLVM Thread Control**: control how many threads LLVM uses during compilation to optimize performance; ## Support of features by backend @@ -58,6 +59,7 @@ Wasmer features: | -------- | ---------- | --------- | ---- | -- | ----- | -------------- | ------- | | Caching | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | | Metering | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | +| Thread Control | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ## Backend support by Operating System