Skip to content

Commit 4629682

Browse files
author
Eric Wheeler
committed
perf: optimize updateTaskHistory for 2800x performance improvement
Remove unnecessary loading and returning of entire task history array. The return value was never used by any caller, so we can make this an O(1) operation instead of O(n) by simply saving the single item. This change significantly improves performance when updating task history, which happens frequently during task execution. Signed-off-by: Eric Wheeler <[email protected]>
1 parent e221174 commit 4629682

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/core/webview/ClineProvider.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,12 +1717,8 @@ export class ClineProvider
17171717
}
17181718
}
17191719

1720-
async updateTaskHistory(item: HistoryItem): Promise<HistoryItem[]> {
1720+
async updateTaskHistory(item: HistoryItem): Promise<void> {
17211721
await setHistoryItems([item])
1722-
1723-
// Return all history items for the current workspace
1724-
const { getHistoryItemsForSearch } = await import("../task-persistence/taskHistory")
1725-
return await getHistoryItemsForSearch({ workspacePath: this.cwd })
17261722
}
17271723

17281724
// ContextProxy

0 commit comments

Comments
 (0)