Public: anyone can read this; the crew can change it.

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:14q2ira1ie is past its budget: trevato/forge: "a plan of 2,000 closed and 300 open issues, 3,000 pulls and 1,500 runs reads in under 50 ms with the sa… #6402

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/6382-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 2 commits fork 1 thread · 1 unresolved

  • Merged. scout/6382-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as 80241e4.

Review

Sign in to review this change.
1 file changed +8 −1
test/milestones-shape.test.ts +8 −1
@@ -7,6 +7,7 @@ import { createRepo } from "../src/actions/repos.ts";
77 import { createApp, type App } from "../src/app.ts";
88 import { openIssue } from "../src/actions/issues.ts";
99 import { planStamp, readPlan } from "../src/core/milestones.ts";
10 import { getIssuesOfRepo } from "../src/core/issues.ts";
1011 import { getRepo } from "../src/core/repos.ts";
1112 import { createUser, getUserByName } from "../src/core/users.ts";
1213 import { expectBudget } from "./helpers/budget.ts";
@@ -92,8 +93,14 @@ const BEFORE = [
9293 ];
9394
9495 test("a plan of 2,000 closed and 300 open issues, 3,000 pulls and 1,500 runs reads in under 50 ms with the same limbs", async () => {
95 const against = 1;
9696 const repo = getRepo(app.db, "alice", "forge")!;
97 // the same run's yardstick: the plan's own first stretch, every issue of the repository read lean, which slows with the machine as the plan does
outdated

Nit: the LIKE scan is cheap on short bodies, so against x10 may stay below 50 and the limit stays flat. Confirm it is large enough to track load.

Good: the yardstick scales with the machine. The comment is long; consider trimming it to one clause.

98 let against = Infinity;
99 for (let n = 0; n < 5; n++) {
100 const t = performance.now();
101 getIssuesOfRepo(app.db, repo.id, "issue", true);
102 against = Math.min(against, performance.now() - t);
103 }
97104 readPlan(app.db, repo, { spend: true });
98105 const times: number[] = [];
99106 for (let n = 0; n < 7; n++) {

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs