aboutsummaryrefslogtreecommitdiffstats
path: root/src/document/bench.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-02 10:53:47 +0100
committertv <tv@krebsco.de>2026-11-02 10:53:47 +0100
commit11dabc03d8624557c146e0796dc4bc9c9c1050ee (patch)
tree768a3582edf3530c969cfae54c6485d48c797be9 /src/document/bench.rs
parent55d33b0f0bc3aa4497842355684da2efa51a6011 (diff)
add remake benchmarks
Diffstat (limited to 'src/document/bench.rs')
-rw-r--r--src/document/bench.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/document/bench.rs b/src/document/bench.rs
index 78f87d8..02b530d 100644
--- a/src/document/bench.rs
+++ b/src/document/bench.rs
@@ -30,7 +30,7 @@ fn sorted(mut heads: Vec<ChangeHash>) -> Vec<ChangeHash> {
}
/// A document with `keys` keys under `data`, each written by a change of its own.
-fn document(keys: usize) -> Document {
+pub(crate) fn document(keys: usize) -> Document {
let mut doc = Document::new();
let mut map = None;
for key in 0..keys {
@@ -47,7 +47,7 @@ fn document(keys: usize) -> Document {
}
/// The median of `runs` timings of `f`.
-fn median(runs: usize, mut f: impl FnMut() -> Duration) -> Duration {
+pub(crate) fn median(runs: usize, mut f: impl FnMut() -> Duration) -> Duration {
let mut times: Vec<Duration> = (0..runs).map(|_| f()).collect();
times.sort_unstable();
times[runs / 2]