Skip to content
This repository was archived by the owner on Nov 27, 2022. It is now read-only.

Commit ad6ceb3

Browse files
Oliver BeckerRalith
authored andcommitted
Bump shipyard to 0.5
1 parent 3e9d5d9 commit ad6ceb3

File tree

1,126 files changed

+86047
-145672
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,126 files changed

+86047
-145672
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ edition = "2018"
99
[dependencies]
1010
bevy_ecs = "0.3"
1111
bincode = "1.3"
12-
cgmath = { version = "0.17", feature = ["serde"] }
12+
cgmath = { version = "0.17", features = ["serde"] }
1313
hecs = { version = "0.5", features = ["column-serialize", "row-serialize"] }
1414
legion = "0.3"
1515
planck_ecs = { version = "1.1.0", features = ["parallel"] }
1616
rayon = "1.3"
1717
ron = "0.6"
1818
serde = { version = "1.0", features = ["derive"] }
19-
shipyard = "0.4"
19+
shipyard = "0.5.0"
2020
specs = {version = "0.16.1", features = ["serde"] }
2121
specs-derive = "0.4.1"
2222

benches/benchmarks.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ fn bench_simple_iter(c: &mut Criterion) {
5555
let mut bench = shipyard::simple_iter::Benchmark::new();
5656
b.iter(move || bench.run());
5757
});
58-
group.bench_function("shipyard (packed)", |b| {
59-
let mut bench = shipyard_packed::simple_iter::Benchmark::new();
60-
b.iter(move || bench.run());
61-
});
6258
group.bench_function("specs", |b| {
6359
let mut bench = specs::simple_iter::Benchmark::new();
6460
b.iter(move || bench.run());
@@ -115,10 +111,6 @@ fn bench_schedule(c: &mut Criterion) {
115111
let mut bench = shipyard::schedule::Benchmark::new();
116112
b.iter(move || bench.run());
117113
});
118-
group.bench_function("shipyard (packed)", |b| {
119-
let mut bench = shipyard_packed::schedule::Benchmark::new();
120-
b.iter(move || bench.run());
121-
});
122114
group.bench_function("specs", |b| {
123115
let mut bench = specs::schedule::Benchmark::new();
124116
b.iter(move || bench.run());
@@ -147,10 +139,6 @@ fn bench_heavy_compute(c: &mut Criterion) {
147139
let mut bench = shipyard::heavy_compute::Benchmark::new();
148140
b.iter(move || bench.run());
149141
});
150-
group.bench_function("shipyard (packed)", |b| {
151-
let mut bench = shipyard_packed::heavy_compute::Benchmark::new();
152-
b.iter(move || bench.run());
153-
});
154142
group.bench_function("specs", |b| {
155143
let mut bench = specs::heavy_compute::Benchmark::new();
156144
b.iter(move || bench.run());

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ pub mod legion;
66
pub mod legion_packed;
77
pub mod planck_ecs;
88
pub mod shipyard;
9-
pub mod shipyard_packed;
109
pub mod specs;

src/shipyard/add_remove.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@ impl Benchmark {
1616
entity_ids.push(entity);
1717
}
1818
entity_ids
19-
});
19+
}).unwrap();
2020

2121
Self(world, entities)
2222
}
2323

2424
pub fn run(&mut self) {
2525
self.0.run(|entities: EntitiesViewMut, mut b: ViewMut<B>| {
2626
for entity in &self.1 {
27-
entities.add_component(&mut b, B(0.0), *entity);
27+
entities.add_component(*entity, &mut b, B(0.0));
2828
}
29-
});
29+
}).unwrap();
3030

3131
self.0.run(|mut b: ViewMut<B>| {
3232
for entity in &self.1 {
3333
b.remove(*entity);
3434
}
35-
});
35+
}).unwrap();
3636
}
3737
}

src/shipyard/frag_iter.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ macro_rules! create_entities {
1414
($variants(0.0), Data(1.0)),
1515
);
1616
}
17-
});
17+
}).unwrap();
1818
)*
1919
};
2020
}
@@ -34,9 +34,9 @@ impl Benchmark {
3434

3535
pub fn run(&mut self) {
3636
self.0.run(|mut data: ViewMut<Data>| {
37-
(&mut data).iter().for_each(|data| {
37+
(&mut data).iter().for_each(|mut data| {
3838
data.0 *= 2.0;
3939
})
40-
});
40+
}).unwrap();
4141
}
4242
}

src/shipyard/heavy_compute.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl Benchmark {
4040
);
4141
}
4242
},
43-
);
43+
).unwrap();
4444

4545
Self(world)
4646
}
@@ -50,13 +50,13 @@ impl Benchmark {
5050
|mut positions: ViewMut<Position>, mut transforms: ViewMut<Matrix4<f32>>| {
5151
(&mut positions, &mut transforms)
5252
.par_iter()
53-
.for_each(|(pos, mat)| {
53+
.for_each(|(mut pos, mut mat)| {
5454
for _ in 0..100 {
5555
*mat = mat.invert().unwrap();
5656
}
5757
pos.0 = mat.transform_vector(pos.0);
5858
});
5959
},
60-
);
60+
).unwrap();
6161
}
6262
}

src/shipyard/schedule.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ struct D(f32);
77
struct E(f32);
88

99
fn ab(mut a: ViewMut<A>, mut b: ViewMut<B>) {
10-
(&mut a, &mut b).iter().for_each(|(a, b)| {
10+
(&mut a, &mut b).iter().for_each(|(mut a, mut b)| {
1111
std::mem::swap(&mut a.0, &mut b.0);
1212
})
1313
}
1414

1515
fn cd(mut c: ViewMut<C>, mut d: ViewMut<D>) {
16-
(&mut c, &mut d).iter().for_each(|(c, d)| {
16+
(&mut c, &mut d).iter().for_each(|(mut c, mut d)| {
1717
std::mem::swap(&mut c.0, &mut d.0);
1818
})
1919
}
2020

2121
fn ce(mut c: ViewMut<C>, mut e: ViewMut<E>) {
22-
(&mut c, &mut e).iter().for_each(|(c, e)| {
22+
(&mut c, &mut e).iter().for_each(|(mut c, mut e)| {
2323
std::mem::swap(&mut c.0, &mut e.0);
2424
})
2525
}
@@ -36,7 +36,7 @@ impl Benchmark {
3636
entities.add_entity((&mut a, &mut b), (A(0.0), B(0.0)));
3737
}
3838
},
39-
);
39+
).unwrap();
4040

4141
world.run(
4242
|mut entities: EntitiesViewMut,
@@ -47,7 +47,7 @@ impl Benchmark {
4747
entities.add_entity((&mut a, &mut b, &mut c), (A(0.0), B(0.0), C(0.0)));
4848
}
4949
},
50-
);
50+
).unwrap();
5151

5252
world.run(
5353
|mut entities: EntitiesViewMut,
@@ -62,7 +62,7 @@ impl Benchmark {
6262
);
6363
}
6464
},
65-
);
65+
).unwrap();
6666

6767
world.run(
6868
|mut entities: EntitiesViewMut,
@@ -77,19 +77,19 @@ impl Benchmark {
7777
);
7878
}
7979
},
80-
);
80+
).unwrap();
8181

82-
world
83-
.add_workload("run")
84-
.with_system(system!(ab))
85-
.with_system(system!(cd))
86-
.with_system(system!(ce))
87-
.build();
82+
Workload::builder("run")
83+
.with_system(&ab)
84+
.with_system(&cd)
85+
.with_system(&ce)
86+
.add_to_world(&world)
87+
.unwrap();
8888

8989
Self(world)
9090
}
9191

9292
pub fn run(&mut self) {
93-
self.0.run_workload("run");
93+
self.0.run_workload("run").unwrap();
9494
}
9595
}

src/shipyard/simple_insert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ impl Benchmark {
4646
);
4747
}
4848
},
49-
);
49+
).unwrap();
5050
}
5151
}

src/shipyard/simple_iter.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl Benchmark {
4242
);
4343
}
4444
},
45-
);
45+
).unwrap();
4646

4747
Self(world)
4848
}
@@ -52,10 +52,10 @@ impl Benchmark {
5252
|velocities: View<Velocity>, mut positions: ViewMut<Position>| {
5353
(&velocities, &mut positions)
5454
.iter()
55-
.for_each(|(velocity, position)| {
55+
.for_each(|(velocity, mut position)| {
5656
position.0 += velocity.0;
5757
})
5858
},
59-
);
59+
).unwrap();
6060
}
6161
}

src/shipyard_packed/heavy_compute.rs

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)