Skip to content
TypeScript

perf(server): sort the working-tree file list once per status read (#22499)

Victor Vogel6a241eaee3ac
diff --git a/apps/server/src/vcs/GitVcsDriverCore.ts b/apps/server/src/vcs/GitVcsDriverCore.ts
index c29cb973db9..bc2f6833363 100644
--- a/apps/server/src/vcs/GitVcsDriverCore.ts
+++ b/apps/server/src/vcs/GitVcsDriverCore.ts
@@ -2316,13 +2316,11 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
let insertions = 0;
let deletions = 0;
- const files = Array.from(fileStatMap.entries())
- .map(([filePath, stat]) => {
- insertions += stat.insertions;
- deletions += stat.deletions;
- return { path: filePath, insertions: stat.insertions, deletions: stat.deletions };
- })
- .toSorted((a, b) => a.path.localeCompare(b.path));
+ const files = Array.from(fileStatMap.entries()).map(([filePath, stat]) => {
+ insertions += stat.insertions;
+ deletions += stat.deletions;
+ return { path: filePath, insertions: stat.insertions, deletions: stat.deletions };
+ });
for (const filePath of changedFilesWithoutNumstat) {
if (fileStatMap.has(filePath)) continue;