Skip to content

Commit 02d8968

Browse files
devlux76Copilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 91a74d3 commit 02d8968

1 file changed

Lines changed: 26 additions & 18 deletions

File tree

tests/benchmarks/HotpathScaling.bench.ts

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -132,33 +132,41 @@ async function assertWilliamsBound(
132132
// Benchmark suites
133133
// ---------------------------------------------------------------------------
134134

135-
describe("Hotpath Scaling — 1K nodes", async () => {
136-
const SCALE = 1_000;
137-
const store = new BenchMetadataStore();
138-
store.seedPages(SCALE);
139-
const allPages = await store.getAllPages();
135+
const SCALE_1K = 1_000;
136+
const store1k = new BenchMetadataStore();
137+
store1k.seedPages(SCALE_1K);
138+
const allPages1k = await store1k.getAllPages();
140139

141-
await bootstrapHotpath(store, DEFAULT_HOTPATH_POLICY, allPages.map((p) => p.pageId));
142-
await assertWilliamsBound(store, SCALE);
140+
await bootstrapHotpath(
141+
store1k,
142+
DEFAULT_HOTPATH_POLICY,
143+
allPages1k.map((p) => p.pageId),
144+
);
145+
await assertWilliamsBound(store1k, SCALE_1K);
143146

147+
describe("Hotpath Scaling — 1K nodes", () => {
144148
bench("promotion sweep — 1K node graph", async () => {
145-
const sample = allPages.slice(0, 20).map((p) => p.pageId);
146-
await runPromotionSweep(sample, store);
149+
const sample = allPages1k.slice(0, 20).map((p) => p.pageId);
150+
await runPromotionSweep(sample, store1k);
147151
});
148152
});
149153

150-
describe("Hotpath Scaling — 5K nodes", async () => {
151-
const SCALE = 5_000;
152-
const store = new BenchMetadataStore();
153-
store.seedPages(SCALE);
154-
const allPages = await store.getAllPages();
154+
const SCALE_5K = 5_000;
155+
const store5k = new BenchMetadataStore();
156+
store5k.seedPages(SCALE_5K);
157+
const allPages5k = await store5k.getAllPages();
155158

156-
await bootstrapHotpath(store, DEFAULT_HOTPATH_POLICY, allPages.map((p) => p.pageId));
157-
await assertWilliamsBound(store, SCALE);
159+
await bootstrapHotpath(
160+
store5k,
161+
DEFAULT_HOTPATH_POLICY,
162+
allPages5k.map((p) => p.pageId),
163+
);
164+
await assertWilliamsBound(store5k, SCALE_5K);
158165

166+
describe("Hotpath Scaling — 5K nodes", () => {
159167
bench("promotion sweep — 5K node graph", async () => {
160-
const sample = allPages.slice(0, 20).map((p) => p.pageId);
161-
await runPromotionSweep(sample, store);
168+
const sample = allPages5k.slice(0, 20).map((p) => p.pageId);
169+
await runPromotionSweep(sample, store5k);
162170
});
163171
});
164172

0 commit comments

Comments
 (0)