Skip to content

Commit 42f8f5b

Browse files
committed
test(session): pin the flatter session-store perf baseline
1 parent d526a61 commit 42f8f5b

2 files changed

Lines changed: 31 additions & 30 deletions

File tree

‎scripts/context-store-perf.test.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ import { createOptimizedContextStore } from "../src/session/optimized-context-st
55
import { createTempDir } from "../testkit/temporary-dirs.js";
66

77
/**
8-
* Pins the per-turn slope of fs.promises.access, counted the same way
8+
* Pins the slope of fs.promises.access, counted the same way
99
* scripts/context-store-perf.ts installCounters counts it (every call, and a
1010
* separate tally when the path is under .git). Synchronous fs is invisible
1111
* here, same as that script. Two turn counts keep a fixed overhead from hiding
12-
* a probe that runs once per turn.
12+
* a probe that runs once per turn. The commit path no longer pays one access
13+
* per turn, so both slopes stay flat.
1314
*/
1415
const LOW_TURNS = 4;
1516
const HIGH_TURNS = 12;
@@ -92,7 +93,7 @@ afterEach(() => {
9293
totals.gitAccess = 0;
9394
});
9495

95-
test("fs.promises.access grows by a fixed per-turn slope", async () => {
96+
test("fs.promises.access slope is flat, not per-turn", async () => {
9697
installCounters();
9798
await runScenario(LOW_TURNS);
9899
const low = { access: totals.access, gitAccess: totals.gitAccess };
@@ -101,6 +102,6 @@ test("fs.promises.access grows by a fixed per-turn slope", async () => {
101102
await runScenario(HIGH_TURNS);
102103
const high = { access: totals.access, gitAccess: totals.gitAccess };
103104
const span = HIGH_TURNS - LOW_TURNS;
104-
expect((high.access - low.access) / span).toBe(1);
105+
expect((high.access - low.access) / span).toBe(0);
105106
expect((high.gitAccess - low.gitAccess) / span).toBe(0);
106107
});

‎scripts/results/session-store-perf-baseline.json‎

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,51 +10,51 @@
1010
],
1111
"contextStorePerf": {
1212
"turnCount": 200,
13-
"wallMs": 744,
13+
"wallMs": 814,
1414
"loadedTurns": 250,
15-
"totalFsOps": 21396,
16-
"gitPathFsOps": 10385,
15+
"totalFsOps": 15736,
16+
"gitPathFsOps": 7717,
1717
"fsOps": {
18-
"readFile": 10881,
19-
"mkdir": 247,
20-
"writeFile": 1275,
21-
"stat": 3141,
22-
"lstat": 4249,
23-
"readdir": 1203,
24-
"access": 202,
18+
"readFile": 7878,
19+
"mkdir": 246,
20+
"writeFile": 1274,
21+
"stat": 2580,
22+
"lstat": 2948,
23+
"readdir": 611,
24+
"access": 1,
2525
"open": 198
2626
},
2727
"gitPathFsOpsByName": {
28-
"stat": 1273,
29-
"mkdir": 241,
30-
"writeFile": 1269,
31-
"lstat": 1324,
32-
"readFile": 6278
28+
"stat": 679,
29+
"mkdir": 240,
30+
"writeFile": 1268,
31+
"lstat": 1067,
32+
"readFile": 4463
3333
},
3434
"perTurn": {
35-
"wallMs": 3.72,
36-
"fsOps": 106.98
35+
"wallMs": 4.07,
36+
"fsOps": 78.68
3737
}
3838
},
3939
"turnPersistenceCensus": {
4040
"flow": "coalesced",
4141
"turnCount": 200,
42-
"wallMs": 642,
42+
"wallMs": 696,
4343
"loadedTurns": 800,
44-
"totalWriteOps": 2088,
45-
"gitPathWriteOps": 1678,
44+
"totalWriteOps": 2097,
45+
"gitPathWriteOps": 1687,
4646
"byName": {
47-
"mkdir": 246,
48-
"writeFile": 1642,
47+
"mkdir": 251,
48+
"writeFile": 1646,
4949
"appendFile": 200
5050
},
5151
"gitByPath": {
52-
"mkdir": 240,
53-
"writeFile": 1438
52+
"mkdir": 245,
53+
"writeFile": 1442
5454
},
5555
"perTurn": {
56-
"wallMs": 3.21,
57-
"writeOps": 10.44
56+
"wallMs": 3.48,
57+
"writeOps": 10.48
5858
},
5959
"persistCalls": {
6060
"writePrompt": 200,

0 commit comments

Comments
 (0)