Skip to content

Commit

Permalink
feat: re-implement parallel argument
Browse files Browse the repository at this point in the history
  • Loading branch information
BD103 committed Dec 9, 2024
1 parent b0065e0 commit df26ba2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions benches/benches/bevy_ecs/empty_archetypes.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bevy_ecs::{component::Component, prelude::*, world::World};
use bevy_ecs::{component::Component, prelude::*, schedule::ExecutorKind, world::World};
use criterion::{black_box, criterion_group, BenchmarkId, Criterion};

criterion_group!(benches, empty_archetypes);
Expand Down Expand Up @@ -72,14 +72,17 @@ fn par_for_each(
});
}

#[expect(
unused_variables,
reason = "`parallel` has no effect, it needs to be removed or parallel support needs to be re-added."
)]
fn setup(parallel: bool, setup: impl FnOnce(&mut Schedule)) -> (World, Schedule) {
let world = World::new();
let mut schedule = Schedule::default();

schedule.set_executor_kind(match parallel {
true => ExecutorKind::MultiThreaded,
false => ExecutorKind::SingleThreaded,
});

setup(&mut schedule);

(world, schedule)
}

Expand Down

0 comments on commit df26ba2

Please sign in to comment.