Additional benchmarks

This commit is contained in:
kyren 2018-03-11 17:50:17 -04:00
parent a5377b959f
commit 84ee394b1d
1 changed files with 18 additions and 1 deletions

View File

@ -153,6 +153,22 @@ fn call_append_callback(c: &mut Criterion) {
);
});
}
fn create_registry_values(c: &mut Criterion) {
c.bench_function("create registry 10", |b| {
b.iter_with_setup(
|| Lua::new(),
|lua| -> Lua {
for _ in 0..10 {
lua.create_registry_value(lua.pack(true).unwrap()).unwrap();
}
lua.expire_registry_values();
lua
},
);
});
}
criterion_group! {
name = benches;
config = Criterion::default()
@ -164,7 +180,8 @@ criterion_group! {
create_string_table,
call_add_function,
call_add_callback,
call_append_callback
call_append_callback,
create_registry_values
}
criterion_main!(benches);