In order to properly understand the impact of providing thread-safe implmentations of WASI contexts (#5235), we need benchmarks that measure the current performance of WASI calls using Wiggle. This change adds several common WASI scenarios as WAT files (see `benches/wasi/*.wat`) and benchmarks them with `criterion`. Using `criterion`'s `iter_custom`, the WAT file runs the desired number of benchmark iterations internally and the total duration of the runs is divided to get the average time for each loop iteration. Why WAT? When compiling these benchmarks from Rust to `wasm32-wasi`, the output files are large, contain other WASI imports than the desired ones, and overall it is difficult to tell if we are measuring what we expect. By hand-writing the WAT, it is (slightly) more clear what each benchmark is doing.
232 lines
7.7 KiB
TOML
232 lines
7.7 KiB
TOML
[package]
|
|
name = "wasmtime-cli"
|
|
version.workspace = true
|
|
authors.workspace = true
|
|
description = "Command-line interface for Wasmtime"
|
|
license = "Apache-2.0 WITH LLVM-exception"
|
|
documentation = "https://bytecodealliance.github.io/wasmtime/cli.html"
|
|
categories = ["wasm"]
|
|
keywords = ["webassembly", "wasm"]
|
|
repository = "https://github.com/bytecodealliance/wasmtime"
|
|
readme = "README.md"
|
|
edition.workspace = true
|
|
default-run = "wasmtime"
|
|
|
|
[lib]
|
|
doctest = false
|
|
|
|
[[bin]]
|
|
name = "wasmtime"
|
|
path = "src/bin/wasmtime.rs"
|
|
doc = false
|
|
|
|
[dependencies]
|
|
wasmtime = { workspace = true, features = ['cache', 'cranelift'] }
|
|
wasmtime-cache = { workspace = true }
|
|
wasmtime-cli-flags = { workspace = true }
|
|
wasmtime-cranelift = { workspace = true }
|
|
wasmtime-environ = { workspace = true }
|
|
wasmtime-wast = { workspace = true }
|
|
wasmtime-wasi = { workspace = true }
|
|
wasmtime-wasi-crypto = { workspace = true, optional = true }
|
|
wasmtime-wasi-nn = { workspace = true, optional = true }
|
|
clap = { workspace = true, features = ["color", "suggestions", "derive"] }
|
|
anyhow = { workspace = true }
|
|
target-lexicon = { workspace = true }
|
|
libc = "0.2.60"
|
|
humantime = "2.0.0"
|
|
once_cell = { workspace = true }
|
|
listenfd = "1.0.0"
|
|
wat = { workspace = true }
|
|
|
|
[target.'cfg(unix)'.dependencies]
|
|
rustix = { workspace = true, features = ["mm", "param"] }
|
|
|
|
[dev-dependencies]
|
|
# depend again on wasmtime to activate its default features for tests
|
|
wasmtime = { workspace = true, features = ['component-model', 'async', 'default'] }
|
|
env_logger = { workspace = true }
|
|
log = { workspace = true }
|
|
filecheck = "0.5.0"
|
|
tempfile = "3.1.0"
|
|
test-programs = { path = "crates/test-programs" }
|
|
wasmtime-runtime = { workspace = true }
|
|
tokio = { version = "1.8.0", features = ["rt", "time", "macros", "rt-multi-thread"] }
|
|
wast = { workspace = true }
|
|
criterion = "0.3.4"
|
|
num_cpus = "1.13.0"
|
|
memchr = "2.4"
|
|
async-trait = "0.1"
|
|
wat = { workspace = true }
|
|
rayon = "1.5.0"
|
|
wasmtime-wast = { workspace = true, features = ['component-model'] }
|
|
wasmtime-component-util = { workspace = true }
|
|
component-macro-test = { path = "crates/misc/component-macro-test" }
|
|
component-test-util = { workspace = true }
|
|
|
|
[target.'cfg(windows)'.dev-dependencies]
|
|
windows-sys = { workspace = true, features = ["Win32_System_Memory"] }
|
|
|
|
[build-dependencies]
|
|
anyhow = { workspace = true }
|
|
|
|
[profile.release.build-override]
|
|
opt-level = 0
|
|
|
|
[workspace]
|
|
resolver = '2'
|
|
members = [
|
|
"cranelift",
|
|
"cranelift/egraph",
|
|
"cranelift/isle/fuzz",
|
|
"cranelift/isle/islec",
|
|
"cranelift/serde",
|
|
"crates/bench-api",
|
|
"crates/c-api",
|
|
"crates/cli-flags",
|
|
"crates/environ/fuzz",
|
|
"crates/jit-icache-coherence",
|
|
"crates/winch",
|
|
"examples/fib-debug/wasm",
|
|
"examples/wasi/wasm",
|
|
"examples/tokio/wasm",
|
|
"fuzz",
|
|
"winch",
|
|
"winch/codegen"
|
|
]
|
|
exclude = [
|
|
'crates/wasi-common/WASI/tools/witx-cli',
|
|
'docs/rust_wasi_markdown_parser'
|
|
]
|
|
|
|
[workspace.package]
|
|
version = "4.0.0"
|
|
authors = ["The Wasmtime Project Developers"]
|
|
edition = "2021"
|
|
|
|
[workspace.dependencies]
|
|
wasmtime = { path = "crates/wasmtime", version = "4.0.0", default-features = false }
|
|
wasmtime-cache = { path = "crates/cache", version = "=4.0.0" }
|
|
wasmtime-cli-flags = { path = "crates/cli-flags", version = "=4.0.0" }
|
|
wasmtime-cranelift = { path = "crates/cranelift", version = "=4.0.0" }
|
|
wasmtime-environ = { path = "crates/environ", version = "=4.0.0" }
|
|
wasmtime-fiber = { path = "crates/fiber", version = "=4.0.0" }
|
|
wasmtime-types = { path = "crates/types", version = "4.0.0" }
|
|
wasmtime-jit = { path = "crates/jit", version = "=4.0.0" }
|
|
wasmtime-jit-debug = { path = "crates/jit-debug", version = "=4.0.0" }
|
|
wasmtime-runtime = { path = "crates/runtime", version = "=4.0.0" }
|
|
wasmtime-wast = { path = "crates/wast", version = "=4.0.0" }
|
|
wasmtime-wasi = { path = "crates/wasi", version = "4.0.0" }
|
|
wasmtime-wasi-crypto = { path = "crates/wasi-crypto", version = "4.0.0" }
|
|
wasmtime-wasi-nn = { path = "crates/wasi-nn", version = "4.0.0" }
|
|
wasmtime-component-util = { path = "crates/component-util", version = "=4.0.0" }
|
|
wasmtime-component-macro = { path = "crates/component-macro", version = "=4.0.0" }
|
|
wasmtime-asm-macros = { path = "crates/asm-macros", version = "=4.0.0" }
|
|
component-test-util = { path = "crates/misc/component-test-util" }
|
|
component-fuzz-util = { path = "crates/misc/component-fuzz-util" }
|
|
wiggle = { path = "crates/wiggle", version = "=4.0.0", default-features = false }
|
|
wiggle-macro = { path = "crates/wiggle/macro", version = "=4.0.0" }
|
|
wiggle-generate = { path = "crates/wiggle/generate", version = "=4.0.0" }
|
|
wasi-common = { path = "crates/wasi-common", version = "=4.0.0" }
|
|
wasi-tokio = { path = "crates/wasi-common/tokio", version = "=4.0.0" }
|
|
wasi-cap-std-sync = { path = "crates/wasi-common/cap-std-sync", version = "=4.0.0" }
|
|
wasmtime-fuzzing = { path = "crates/fuzzing" }
|
|
wasmtime-jit-icache-coherence = { path = "crates/jit-icache-coherence", version = "=3.0.0" }
|
|
|
|
cranelift-wasm = { path = "cranelift/wasm", version = "0.91.0" }
|
|
cranelift-codegen = { path = "cranelift/codegen", version = "0.91.0" }
|
|
cranelift-egraph = { path = "cranelift/egraph", version = "0.91.0" }
|
|
cranelift-frontend = { path = "cranelift/frontend", version = "0.91.0" }
|
|
cranelift-entity = { path = "cranelift/entity", version = "0.91.0" }
|
|
cranelift-native = { path = "cranelift/native", version = "0.91.0" }
|
|
cranelift-module = { path = "cranelift/module", version = "0.91.0" }
|
|
cranelift-interpreter = { path = "cranelift/interpreter", version = "0.91.0" }
|
|
cranelift-reader = { path = "cranelift/reader", version = "0.91.0" }
|
|
cranelift-filetests = { path = "cranelift/filetests" }
|
|
cranelift-object = { path = "cranelift/object", version = "0.91.0" }
|
|
cranelift-jit = { path = "cranelift/jit", version = "0.91.0" }
|
|
cranelift-preopt = { path = "cranelift/preopt", version = "0.91.0" }
|
|
cranelift-fuzzgen = { path = "cranelift/fuzzgen" }
|
|
cranelift-bforest = { path = "cranelift/bforest", version = "0.91.0" }
|
|
cranelift = { path = "cranelift/umbrella", version = "0.91.0" }
|
|
|
|
winch-codegen = { path = "winch/codegen", version = "=0.2.0" }
|
|
|
|
target-lexicon = { version = "0.12.3", default-features = false }
|
|
anyhow = "1.0.22"
|
|
wasmparser = "0.94.0"
|
|
wat = "1.0.51"
|
|
wast = "49.0.0"
|
|
wasmprinter = "0.2.43"
|
|
wasm-encoder = "0.19.1"
|
|
wasm-smith = "0.11.8"
|
|
wasm-mutate = "0.2.11"
|
|
windows-sys = "0.36.0"
|
|
env_logger = "0.9"
|
|
rustix = "0.35.10"
|
|
log = { version = "0.4.8", default-features = false }
|
|
object = { version = "0.29", default-features = false, features = ['read_core', 'elf', 'std'] }
|
|
gimli = { version = "0.26.0", default-features = false, features = ['read', 'std'] }
|
|
clap = { version = "3.2.0", features = ["color", "suggestions", "derive"] }
|
|
hashbrown = "0.12"
|
|
cap-std = "0.26.0"
|
|
once_cell = "1.12.0"
|
|
smallvec = { version = "1.6.1", features = ["union"] }
|
|
|
|
[features]
|
|
default = [
|
|
"jitdump",
|
|
"wasmtime/wat",
|
|
"wasmtime/parallel-compilation",
|
|
"vtune",
|
|
"wasi-nn",
|
|
"pooling-allocator",
|
|
]
|
|
jitdump = ["wasmtime/jitdump"]
|
|
vtune = ["wasmtime/vtune"]
|
|
wasi-crypto = ["dep:wasmtime-wasi-crypto"]
|
|
wasi-nn = ["dep:wasmtime-wasi-nn"]
|
|
pooling-allocator = ["wasmtime/pooling-allocator", "wasmtime-cli-flags/pooling-allocator"]
|
|
all-arch = ["wasmtime/all-arch"]
|
|
posix-signals-on-macos = ["wasmtime/posix-signals-on-macos"]
|
|
component-model = [
|
|
"wasmtime/component-model",
|
|
"wasmtime-wast/component-model",
|
|
"wasmtime-cli-flags/component-model"
|
|
]
|
|
|
|
# Stub feature that does nothing, for Cargo-features compatibility: the new
|
|
# backend is the default now.
|
|
experimental_x64 = []
|
|
|
|
[badges]
|
|
maintenance = { status = "actively-developed" }
|
|
|
|
[[test]]
|
|
name = "host_segfault"
|
|
harness = false
|
|
|
|
[[example]]
|
|
name = "tokio"
|
|
required-features = ["wasmtime-wasi/tokio"]
|
|
|
|
[[bench]]
|
|
name = "instantiation"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "thread_eager_init"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "trap"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "call"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
name = "wasi"
|
|
harness = false
|