mirror of
https://github.com/bevyengine/bevy
synced 2024-11-21 20:23:28 +00:00
Fix broken bezier curve benchmark (#14677)
# Objective Apparently #14382 broke this, but it's not a part of CI, so it wasn't found until earlier today. ## Solution Update the benchmark like we updated the examples. ## Testing Running `cargo bench` actually works now.
This commit is contained in:
parent
c3111bebb8
commit
4ace888e4b
1 changed files with 10 additions and 5 deletions
|
@ -20,7 +20,8 @@ fn cubic_2d(c: &mut Criterion) {
|
|||
vec2(1.0, 0.0),
|
||||
vec2(1.0, 1.0),
|
||||
]])
|
||||
.to_curve();
|
||||
.to_curve()
|
||||
.expect("Unable to build a curve from this data");
|
||||
c.bench_function("cubic_position_Vec2", |b| {
|
||||
b.iter(|| black_box(bezier.position(black_box(0.5))));
|
||||
});
|
||||
|
@ -33,7 +34,8 @@ fn cubic(c: &mut Criterion) {
|
|||
vec3a(1.0, 0.0, 0.0),
|
||||
vec3a(1.0, 1.0, 1.0),
|
||||
]])
|
||||
.to_curve();
|
||||
.to_curve()
|
||||
.expect("Unable to build a curve from this data");
|
||||
c.bench_function("cubic_position_Vec3A", |b| {
|
||||
b.iter(|| black_box(bezier.position(black_box(0.5))));
|
||||
});
|
||||
|
@ -46,7 +48,8 @@ fn cubic_vec3(c: &mut Criterion) {
|
|||
vec3(1.0, 0.0, 0.0),
|
||||
vec3(1.0, 1.0, 1.0),
|
||||
]])
|
||||
.to_curve();
|
||||
.to_curve()
|
||||
.expect("Unable to build a curve from this data");
|
||||
c.bench_function("cubic_position_Vec3", |b| {
|
||||
b.iter(|| black_box(bezier.position(black_box(0.5))));
|
||||
});
|
||||
|
@ -59,7 +62,8 @@ fn build_pos_cubic(c: &mut Criterion) {
|
|||
vec3a(1.0, 0.0, 0.0),
|
||||
vec3a(1.0, 1.0, 1.0),
|
||||
]])
|
||||
.to_curve();
|
||||
.to_curve()
|
||||
.expect("Unable to build a curve from this data");
|
||||
c.bench_function("build_pos_cubic_100_points", |b| {
|
||||
b.iter(|| black_box(bezier.iter_positions(black_box(100)).collect::<Vec<_>>()));
|
||||
});
|
||||
|
@ -72,7 +76,8 @@ fn build_accel_cubic(c: &mut Criterion) {
|
|||
vec3a(1.0, 0.0, 0.0),
|
||||
vec3a(1.0, 1.0, 1.0),
|
||||
]])
|
||||
.to_curve();
|
||||
.to_curve()
|
||||
.expect("Unable to build a curve from this data");
|
||||
c.bench_function("build_accel_cubic_100_points", |b| {
|
||||
b.iter(|| black_box(bezier.iter_positions(black_box(100)).collect::<Vec<_>>()));
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue