Files
wasmtime/fuzz/Cargo.toml
Jamey Sharp bd870a9d6c Shrink all SmallVecs by 8 bytes (#4951)
We weren't using the "union" cargo feature for the smallvec crate, which
reduces the size of a SmallVec by one machine word. This feature
requires Rust 1.49 but we already require much newer versions.

When using Wasmtime to compile pulldown-cmark from Sightglass, this
saves a decent amount of memory allocations and writes. According to
`valgrind --tool=dhat`:

- 6.2MiB (3.69%) less memory allocated over the program's lifetime
- 0.5MiB (4.13%) less memory allocated at maximum heap size
- 5.5MiB (1.88%) fewer bytes written to
- 0.44% fewer instructions executed

Sightglass reports a statistically significant runtime improvement too:

compilation :: cycles :: benchmarks/pulldown-cmark/benchmark.wasm

  Δ = 24379323.60 ± 20051394.04 (confidence = 99%)

  shrink-abiarg-0406da67c.so is 1.01x to 1.13x faster than main-be690a468.so!

  [227506364 355007998.78 423280514] main-be690a468.so
  [227686018 330628675.18 406025344] shrink-abiarg-0406da67c.so

compilation :: cycles :: benchmarks/spidermonkey/benchmark.wasm

  Δ = 360151622.56 ± 278294316.90 (confidence = 99%)

  shrink-abiarg-0406da67c.so is 1.01x to 1.07x faster than main-be690a468.so!

  [8709162212 8911001926.44 9535111576] main-be690a468.so
  [5058015392 8550850303.88 9282148438] shrink-abiarg-0406da67c.so

compilation :: cycles :: benchmarks/bz2/benchmark.wasm

  Δ = 6936570.28 ± 6897696.38 (confidence = 99%)

  shrink-abiarg-0406da67c.so is 1.00x to 1.08x faster than main-be690a468.so!

  [155810934 175260571.20 234737344] main-be690a468.so
  [119128240 168324000.92 257451074] shrink-abiarg-0406da67c.so
2022-09-23 16:32:13 -07:00

110 lines
2.4 KiB
TOML

[package]
name = "wasmtime-fuzz"
version = "0.0.0"
authors = ["The Wasmtime Project Developers"]
edition = "2021"
publish = false
[package.metadata]
cargo-fuzz = true
[dependencies]
anyhow = { version = "1.0.19" }
cranelift-codegen = { path = "../cranelift/codegen", features = ["incremental-cache"] }
cranelift-reader = { path = "../cranelift/reader" }
cranelift-wasm = { path = "../cranelift/wasm" }
cranelift-filetests = { path = "../cranelift/filetests" }
cranelift-interpreter = { path = "../cranelift/interpreter" }
cranelift-fuzzgen = { path = "../cranelift/fuzzgen" }
libfuzzer-sys = { version = "0.4.0", features = ["arbitrary-derive"] }
target-lexicon = "0.12"
smallvec = { version = "1.6.1", features = ["union"] }
wasmtime = { path = "../crates/wasmtime" }
wasmtime-fuzzing = { path = "../crates/fuzzing" }
component-test-util = { path = "../crates/misc/component-test-util" }
component-fuzz-util = { path = "../crates/misc/component-fuzz-util" }
[build-dependencies]
anyhow = "1.0.19"
proc-macro2 = "1.0"
arbitrary = { version = "1.1.0", features = ["derive"] }
rand = { version = "0.8.0" }
quote = "1.0"
component-fuzz-util = { path = "../crates/misc/component-fuzz-util" }
[features]
default = ['fuzz-spec-interpreter']
fuzz-spec-interpreter = ['wasmtime-fuzzing/fuzz-spec-interpreter']
[[bin]]
name = "compile"
path = "fuzz_targets/compile.rs"
test = false
doc = false
[[bin]]
name = "instantiate"
path = "fuzz_targets/instantiate.rs"
test = false
doc = false
[[bin]]
name = "api_calls"
path = "fuzz_targets/api_calls.rs"
test = false
doc = false
[[bin]]
name = "differential"
path = "fuzz_targets/differential.rs"
test = false
doc = false
[[bin]]
name = "spectests"
path = "fuzz_targets/spectests.rs"
test = false
doc = false
[[bin]]
name = "table_ops"
path = "fuzz_targets/table_ops.rs"
test = false
doc = false
[[bin]]
name = "stacks"
path = "fuzz_targets/stacks.rs"
test = false
doc = false
[[bin]]
name = "compile-maybe-invalid"
path = "fuzz_targets/compile-maybe-invalid.rs"
test = false
doc = false
[[bin]]
name = "cranelift-fuzzgen"
path = "fuzz_targets/cranelift-fuzzgen.rs"
test = false
doc = false
[[bin]]
name = "instantiate-many"
path = "fuzz_targets/instantiate-many.rs"
test = false
doc = false
[[bin]]
name = "component_api"
path = "fuzz_targets/component_api.rs"
test = false
doc = false
[[bin]]
name = "cranelift-icache"
path = "fuzz_targets/cranelift-icache.rs"
test = false
doc = false