Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ jobs:
run: cargo bench --no-run
- name: all features
run: cargo bench --all-features --no-run
callgrind:
name: Callgrind
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v7
- name: install
uses: dtolnay/rust-toolchain@nightly
- name: default features
run: |
sudo apt-get update -y
sudo apt-get install -y valgrind
version=$(cargo metadata --format-version=1 | jq -r '.packages[] | select(.name == "iai-callgrind").version')
cargo install iai-callgrind-runner --version "$version"
cargo bench --bench callgrind --profile callgrind
- name: all features
run: cargo bench --bench callgrind --profile callgrind --all-features
practices:
name: Practices
runs-on: ubuntu-latest
Expand Down
104 changes: 104 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ opt-level = 3
debug = false
strip = true

# Dedicated profile for the iai-callgrind benchmarks. Callgrind needs the
# function symbols in the binary to attribute event counts, so we disable
# stripping (and keep debug info for line-level detail). Without symbols the
# runner collects zero events for every benchmark. LTO is left on (inherited)
# since it does not affect collection and keeps the run representative.
[profile.callgrind]
inherits = "bench"
debug = 1
strip = false

[features]
allocator-api = []
allocator-api2 = ["dep:allocator-api2", "allocator-api"]
Expand All @@ -41,6 +51,7 @@ malloc_size_of = { version = "0.1", optional = true, default-features = false }
[dev-dependencies]
serde_test = "1.0"
criterion = "0.8"
iai-callgrind = "0.14"

[[test]]
name = "arbitrary"
Expand Down Expand Up @@ -75,6 +86,11 @@ name = "bench"
path = "benches/bench.rs"
harness = false

[[bench]]
name = "callgrind"
path = "benches/callgrind.rs"
harness = false

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
Expand Down
Loading
Loading