wasmedge-compile(1) | General Commands Manual | wasmedge-compile(1) |
wasmedge-compile - AOT compiler for WasmEdge
wasmedge compile [OPTIONS] [--] WASM_OR_SO [ARG ...]
The wasmedge compile subcommand compiles WebAssembly into native machine code, i.e. it is an Ahead-of-Time (AOT) compiler.
For pure WebAssembly, the wasmedge(1) program (or the equivalent wasmedge run subcommand) will execute the WebAssembly code in interpreter mode. However, after compiling it with the wasmedge compile AOT compiler, the wasmedge subcommand can execute the WASM in AOT mode, with substantial performance improvements.
wasmedge compile was previously known as wasmedgec.
Assuming a WebAssembly program placed under the file fibonacci.wasm, set up so to export a fib() function and accepting a single i32 integer as the input parameter, one can execute the following:
$ wasmedge compile fibonacci.wasm fibonacci_aot.wasm $ time wasmedge --reactor fibonacci_aot.wasm fib 30
The execution should be much faster compared to interpreter mode:
time wasmedge --reactor fibonacci.wasm fib 30
Copyright © 2019-2022 Second State INC. Licensed under the Apache License, Version 2.0.
wasmedge(1)
A complete manual of WasmEdge <https://wasmedge.org/docs/> can be found online.
2024-04-01 |