mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-16 05:36:50 +00:00
Switch to Criterion for benchtests.
ci: Add benches to workflow. Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
1 parent
a47f8f8a82
commit
89be6dc097
17 files changed
+334
-166
No files matched your search
@@ -0,0 +1,19 @@
|
||||
use criterion::{Criterion, criterion_group, criterion_main};
|
||||
|
||||
criterion_group!(benches, ser_str,);
|
||||
|
||||
criterion_main!(benches);
|
||||
|
||||
fn ser_str(b: &mut Criterion) {
|
||||
b.bench_function("ser_str", |c| {
|
||||
use tuwunel_core::ruma::{RoomId, UserId};
|
||||
use tuwunel_database::serialize_to_vec;
|
||||
|
||||
let user_id: &UserId = "@user:example.com".try_into().unwrap();
|
||||
let room_id: &RoomId = "!room:example.com".try_into().unwrap();
|
||||
c.iter(|| {
|
||||
let key = (user_id, room_id);
|
||||
let _s = serialize_to_vec(key).expect("failed to serialize user_id");
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user