use aktrs::actor::{self, SpawnOptions}; use criterion::{criterion_group, criterion_main, BatchSize, Criterion}; fn actor_creation(c: &mut Criterion) { #[path = "../examples/actor_creation.rs"] #[allow(dead_code)] mod ex; c.bench_function("actor_creation[1024]", |b| { b.iter_batched( || actor::System::new().expect("failed to create actor system"), |mut sys| { sys.spawn(ex::coordinator(10), SpawnOptions::default()); sys.run().expect("actor system failed to run") }, BatchSize::SmallInput, ) }); } criterion_group!(benches, actor_creation); criterion_main!(benches);