Fix benchmark test
This commit is contained in:
parent
1074cc7ee3
commit
ef8e20bb86
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "eventbus"
|
name = "eventbus"
|
||||||
version = "0.5.1"
|
version = "0.5.2"
|
||||||
authors = ["SoniEx2 <endermoneymod@gmail.com>"]
|
authors = ["SoniEx2 <endermoneymod@gmail.com>"]
|
||||||
description = "Safe, fast and concurrent event system, inspired by the MinecraftForge event bus."
|
description = "Safe, fast and concurrent event system, inspired by the MinecraftForge event bus."
|
||||||
keywords = ["event", "safe", "fast", "concurrent", "bus"]
|
keywords = ["event", "safe", "fast", "concurrent", "bus"]
|
||||||
|
|
|
@ -18,7 +18,7 @@ fn my_hook(_event: &mut MyEvent) {
|
||||||
fn criterion_benchmark(c: &mut Criterion) {
|
fn criterion_benchmark(c: &mut Criterion) {
|
||||||
let bus = EventBus::new();
|
let bus = EventBus::new();
|
||||||
register_hook!(&bus, 0, MyEvent, my_hook);
|
register_hook!(&bus, 0, MyEvent, my_hook);
|
||||||
c.bench_function("one_hook", move |b| b.iter(|| post_event!(&bus, MyEvent, &mut MyEvent {})));
|
c.bench_function("one_hook", move |b| b.iter(|| post_event!(&bus, &mut MyEvent {}, MyEvent)));
|
||||||
}
|
}
|
||||||
|
|
||||||
criterion_group!(benches, criterion_benchmark);
|
criterion_group!(benches, criterion_benchmark);
|
||||||
|
|
Loading…
Reference in New Issue