Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): checkpoint capture scans the index listing by record instead of by byte #21329

Mergedjosephv123(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/21329/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 31 additions and 19 deletions.

x
0 of 2 viewed, 2 left
9 additions and 5 deletionsapps/server/src/vcs/GitVcsDriver.test.tsModified
View file
@@ -682,9 +682,13 @@
}).pipe(Effect.scoped, Effect.provide(layerGitContract)),
​
-it.effect.each(["normal", "flags", "sparse"] as const)(
- "checkpoint index inspection handles entries beyond the output cap (index=%s)",
- (indexMode) =>
+it.effect.each(
+ (["normal", "flags", "sparse"] as const).flatMap((indexMode) =>
+ [1, 3, 4096].map((chunkSize) => ({ indexMode, chunkSize })),
+ ),
+)(
+ "checkpoint index inspection handles entries beyond the output cap (index=$indexMode, chunk=$chunkSize)",
+ ({ indexMode, chunkSize }) =>
Effect.gen(function* () {
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
@@ -720,8 +724,8 @@
...input,
maxOutputBytes: 8,
onStdoutChunk: (chunk) => {
- for (let i = 0; i < chunk.length; i++)
- input.onStdoutChunk?.(chunk.subarray(i, i + 1));
+ for (let i = 0; i < chunk.length; i += chunkSize)
+ input.onStdoutChunk?.(chunk.subarray(i, i + chunkSize));
: input,