Skip to content

Commit 4775706

Browse files
committed
criterion benchmark stub
1 parent 361b347 commit 4775706

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

Cargo.toml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,3 @@ log = "0.4"
2222
glam = "0.24.2"
2323
winit = { version = "0.27" }
2424
wgpu = { version = "0.17" }
25-
26-
# Enable incremental by default in release mode.
27-
[profile.release]
28-
incremental = true
29-
# HACK(eddyb) this is the default but without explicitly specifying it, Cargo
30-
# will treat the identical settings in `[profile.release.build-override]` below
31-
# as different sets of `rustc` flags and will not reuse artifacts between them.
32-
codegen-units = 256
33-
34-
# Compile build-dependencies in release mode with the same settings
35-
# as regular dependencies (including the incremental enabled above).
36-
[profile.release.build-override]
37-
opt-level = 3
38-
incremental = true
39-
codegen-units = 256

crates/renderling/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,14 @@ wgpu = { workspace = true, features = ["spirv"] }
4343
features = ["gltf", "text", "raw-window-handle", "winit"]
4444

4545
[dev-dependencies]
46+
criterion = "0.4"
4647
ctor = "0.2.2"
4748
env_logger = "0.10.0"
4849
icosahedron = "0.1"
4950
img-diff = { path = "../img-diff" }
5051
naga = { version = "0.13", features = ["spv-in", "wgsl-out", "wgsl-in", "msl-out"] }
5152
pretty_assertions = "1.4.0"
53+
54+
[[bench]]
55+
name = "benchmarks"
56+
harness = false
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
use criterion::{black_box, criterion_group, criterion_main, Criterion};
2+
3+
fn renderling_benchmark(c: &mut Criterion) {
4+
c.bench_function("renderling_stub", |b| b.iter(|| black_box(1 + 1)));
5+
}
6+
7+
criterion_group!(benches, renderling_benchmark);
8+
criterion_main!(benches);

0 commit comments

Comments
 (0)