Files
tuwunel/src/database/benches/ser.rs
Jason Volk 8d6bfde5a0 Use insta and criterion for main integration test and benches respectively.
docker/ci: Separate integration and unit tests and benches jobs.

Add directives to remove db before/after integration tests are performed.

Split start/run/stop phases; add more granular smoketests.

Split main integration tests into units for isolation.

Signed-off-by: Jason Volk <jason@zemos.net>
2025-10-02 05:29:48 +00:00

20 lines
545 B
Rust

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");
});
});
}