From b73cd087aa8252ab7877d8a0efea3c78a606947f Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Sun, 11 Oct 2026 18:54:33 +0200 Subject: [PATCH] test(core): time the B12 index write as the best of five runs A single timed run lost the CPU to the rest of the suite running alongside it and read as the full-scan regression (171 ms against 701 ms). The fastest of five runs still catches the 6x scaling of the old path. --- crates/pdfs-core/src/db/tests.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/crates/pdfs-core/src/db/tests.rs b/crates/pdfs-core/src/db/tests.rs index 1131104..324378e 100644 --- a/crates/pdfs-core/src/db/tests.rs +++ b/crates/pdfs-core/src/db/tests.rs @@ -1689,9 +1689,16 @@ fn writing_nodes_does_not_scale_with_the_size_of_the_index() { .collect(); db.upsert_nodes(&batch).unwrap(); - let t = Instant::now(); - db.upsert_nodes(&batch).unwrap(); - t.elapsed() + // The fastest of a few runs: the rest of the suite runs alongside, and + // one run that lost the CPU to it read as the regression. + (0..5) + .map(|_| { + let t = Instant::now(); + db.upsert_nodes(&batch).unwrap(); + t.elapsed() + }) + .min() + .unwrap() } let small = cost_against_index_of(200);