feat(gpodder_sqlite): added benchmarking support
This commit is contained in:
parent
73988d6264
commit
d329a0e61c
4 changed files with 335 additions and 1 deletions
16
gpodder_sqlite/benches/common.rs
Normal file
16
gpodder_sqlite/benches/common.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
use gpodder::{AuthStore, User};
|
||||
use gpodder_sqlite::SqliteRepository;
|
||||
|
||||
pub fn setup() -> (SqliteRepository, Vec<User>) {
|
||||
let store = SqliteRepository::in_memory().unwrap();
|
||||
let mut users = Vec::new();
|
||||
|
||||
for i in 0..1000 {
|
||||
let username = format!("test{}", i + 1);
|
||||
let password_hash = format!("dummyhash{}", i + 1);
|
||||
|
||||
users.push(store.insert_user(&username, &password_hash).unwrap());
|
||||
}
|
||||
|
||||
(store, users)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue