From df26ba2a21c8b33409da8c33866066c15d933aae Mon Sep 17 00:00:00 2001 From: BD103 <59022059+BD103@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:59:50 -0500 Subject: [PATCH] feat: re-implement `parallel` argument --- benches/benches/bevy_ecs/empty_archetypes.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/benches/benches/bevy_ecs/empty_archetypes.rs b/benches/benches/bevy_ecs/empty_archetypes.rs index 84dad61a65c50..139f52ce843d2 100644 --- a/benches/benches/bevy_ecs/empty_archetypes.rs +++ b/benches/benches/bevy_ecs/empty_archetypes.rs @@ -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); @@ -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) }