Skip to content

Commit

Permalink
criterion benchmark stub
Browse files Browse the repository at this point in the history
  • Loading branch information
schell committed Dec 21, 2023
1 parent 361b347 commit 4775706
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
15 changes: 0 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,3 @@ log = "0.4"
glam = "0.24.2"
winit = { version = "0.27" }
wgpu = { version = "0.17" }

# Enable incremental by default in release mode.
[profile.release]
incremental = true
# HACK(eddyb) this is the default but without explicitly specifying it, Cargo
# will treat the identical settings in `[profile.release.build-override]` below
# as different sets of `rustc` flags and will not reuse artifacts between them.
codegen-units = 256

# Compile build-dependencies in release mode with the same settings
# as regular dependencies (including the incremental enabled above).
[profile.release.build-override]
opt-level = 3
incremental = true
codegen-units = 256
5 changes: 5 additions & 0 deletions crates/renderling/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@ wgpu = { workspace = true, features = ["spirv"] }
features = ["gltf", "text", "raw-window-handle", "winit"]

[dev-dependencies]
criterion = "0.4"
ctor = "0.2.2"
env_logger = "0.10.0"
icosahedron = "0.1"
img-diff = { path = "../img-diff" }
naga = { version = "0.13", features = ["spv-in", "wgsl-out", "wgsl-in", "msl-out"] }
pretty_assertions = "1.4.0"

[[bench]]
name = "benchmarks"
harness = false
8 changes: 8 additions & 0 deletions crates/renderling/benches/benchmarks.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
use criterion::{black_box, criterion_group, criterion_main, Criterion};

fn renderling_benchmark(c: &mut Criterion) {
c.bench_function("renderling_stub", |b| b.iter(|| black_box(1 + 1)));
}

criterion_group!(benches, renderling_benchmark);
criterion_main!(benches);

0 comments on commit 4775706

Please sign in to comment.