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
114 lines
3.5 KiB
TOML
114 lines
3.5 KiB
TOML
[package]
|
|
authors = ["The Cranelift Project Developers"]
|
|
name = "cranelift-codegen"
|
|
version = "0.89.0"
|
|
description = "Low-level code generator library"
|
|
license = "Apache-2.0 WITH LLVM-exception"
|
|
documentation = "https://docs.rs/cranelift-codegen"
|
|
repository = "https://github.com/bytecodealliance/wasmtime"
|
|
categories = ["no-std"]
|
|
readme = "README.md"
|
|
keywords = ["compile", "compiler", "jit"]
|
|
build = "build.rs"
|
|
edition = "2021"
|
|
|
|
[dependencies]
|
|
arrayvec = "0.7"
|
|
bumpalo = "3"
|
|
cranelift-codegen-shared = { path = "./shared", version = "0.89.0" }
|
|
cranelift-entity = { path = "../entity", version = "0.89.0" }
|
|
cranelift-bforest = { path = "../bforest", version = "0.89.0" }
|
|
hashbrown = { version = "0.12", optional = true }
|
|
target-lexicon = "0.12"
|
|
log = { version = "0.4.6", default-features = false }
|
|
serde = { version = "1.0.94", features = ["derive"], optional = true }
|
|
bincode = { version = "1.2.1", optional = true }
|
|
gimli = { version = "0.26.0", default-features = false, features = ["write"], optional = true }
|
|
smallvec = { version = "1.6.1", features = ["union"] }
|
|
regalloc2 = { version = "0.4.1", features = ["checker"] }
|
|
souper-ir = { version = "2.1.0", optional = true }
|
|
sha2 = { version = "0.9.0", optional = true }
|
|
# It is a goal of the cranelift-codegen crate to have minimal external dependencies.
|
|
# Please don't add any unless they are essential to the task of creating binary
|
|
# machine code. Integration tests that need external dependencies can be
|
|
# accomodated in `tests`.
|
|
|
|
[dev-dependencies]
|
|
criterion = "0.3"
|
|
|
|
[build-dependencies]
|
|
cranelift-codegen-meta = { path = "meta", version = "0.89.0" }
|
|
cranelift-isle = { path = "../isle/isle", version = "=0.89.0" }
|
|
miette = { version = "5.1.0", features = ["fancy"], optional = true }
|
|
|
|
[features]
|
|
default = ["std", "unwind"]
|
|
|
|
# The "std" feature enables use of libstd. The "core" feature enables use
|
|
# of some minimal std-like replacement libraries. At least one of these two
|
|
# features need to be enabled.
|
|
std = []
|
|
|
|
# The "core" features enables use of "hashbrown" since core doesn't have
|
|
# a HashMap implementation, and a workaround for Cargo #4866.
|
|
core = ["hashbrown"]
|
|
|
|
# This enables some additional functions useful for writing tests, but which
|
|
# can significantly increase the size of the library.
|
|
testing_hooks = []
|
|
|
|
# Enables detailed logging which can be somewhat expensive.
|
|
trace-log = []
|
|
|
|
# This enables unwind info generation functionality.
|
|
unwind = ["gimli"]
|
|
|
|
# ISA targets for which we should build.
|
|
# If no ISA targets are explicitly enabled, the ISA target for the host machine is enabled.
|
|
x86 = []
|
|
arm64 = []
|
|
s390x = []
|
|
|
|
# Stub feature that does nothing, for Cargo-features compatibility: the new
|
|
# backend is the default now.
|
|
experimental_x64 = []
|
|
|
|
# Option to enable all architectures.
|
|
all-arch = [
|
|
"x86",
|
|
"arm64",
|
|
"s390x"
|
|
]
|
|
|
|
# For dependent crates that want to serialize some parts of cranelift
|
|
enable-serde = [
|
|
"serde",
|
|
"cranelift-entity/enable-serde",
|
|
"regalloc2/enable-serde",
|
|
"smallvec/serde"
|
|
]
|
|
|
|
# Enable the incremental compilation cache for hot-reload use cases.
|
|
incremental-cache = [
|
|
"enable-serde",
|
|
"bincode",
|
|
"sha2"
|
|
]
|
|
|
|
# Enable support for the Souper harvester.
|
|
souper-harvest = ["souper-ir", "souper-ir/stringify"]
|
|
|
|
# Provide fancy Miette-produced errors for ISLE.
|
|
isle-errors = ["miette", "cranelift-isle/miette-errors"]
|
|
|
|
# Put ISLE generated files in isle_generated_code/, for easier
|
|
# inspection, rather than inside of target/.
|
|
isle-in-source-tree = []
|
|
|
|
[badges]
|
|
maintenance = { status = "experimental" }
|
|
|
|
[[bench]]
|
|
name = "x64-evex-encoding"
|
|
harness = false
|