Bring the whole workspace into compliance with the repo's rustfmt config (edition 2024, max_width 100, use_small_heuristics = "Max"), which had drifted across many crates. Pure formatting — no logic changes; `cargo fmt --check` is now clean and `cargo build --workspace` is green.
19 lines
596 B
Rust
19 lines
596 B
Rust
use lawsynth_store::{MemoryStore, ObjectKey, ObjectStore};
|
|
use std::hint::black_box;
|
|
use std::time::Instant;
|
|
fn main() {
|
|
let store = MemoryStore::default();
|
|
let start = Instant::now();
|
|
let mut bytes = 0usize;
|
|
for index in 0..10_000 {
|
|
let payload = vec![index as u8; 256];
|
|
bytes += payload.len();
|
|
store.put(ObjectKey::new(format!("throughput/{index}")).unwrap(), payload).unwrap();
|
|
}
|
|
black_box(store.object_count());
|
|
println!(
|
|
"memory object writes: {} MiB/s",
|
|
bytes as f64 / start.elapsed().as_secs_f64() / 1_048_576.0
|
|
);
|
|
}
|