Crates.io | wasmer-compiler-singlepass-near |
lib.rs | wasmer-compiler-singlepass-near |
version | 2.4.1 |
source | src |
created_at | 2021-02-05 00:04:12.197123 |
updated_at | 2023-06-14 09:21:16.800563 |
description | Singlepass compiler for Wasmer WebAssembly runtime |
homepage | |
repository | https://github.com/wasmerio/wasmer |
max_upload_size | |
id | 350783 |
size | 484,018 |
wasmer-compiler-singlepass
This crate contains a compiler implementation based on the Singlepass linear compiler.
use wasmer::{Store, Universal};
use wasmer_compiler_singlepass::Singlepass;
let compiler = Singlepass::new();
// Put it into an engine and add it to the store
let store = Store::new(&Universal::new(compiler).engine());
Note: you can find a full working example using Singlepass compiler here.
Singlepass is designed to emit compiled code at linear time, as such
is not prone to JIT bombs and also offers great compilation
performance orders of magnitude faster than
wasmer-compiler-cranelift
and wasmer-compiler-llvm
, however
with a bit slower runtime speed.
The fact that singlepass is not prone to JIT bombs and offers a very predictable compilation speed makes it ideal for blockchains and other systems where fast and consistent compilation times are very critical.