Code change:
//#region Workspaces History async addRecentlyOpened(recentToAdd: IRecent[]): Promise<void> { <del> const workspaces: Array<IRecentFolder | IRecentWorkspace> = []; const files: IRecentFile[] = []; </del> <ins> let workspaces: Array<IRecentFolder | IRecentWorkspace> = []; let files: IRecentFile[] = []; </ins> for (const recent of recentToAdd) { // Workspace if (isRecentWorkspace(recent)) { <del> if (!this.workspacesManagementMainService.isUntitledWorkspace(recent.workspace) && this.indexOfWorkspace(workspaces, recent.workspace) === -1) { </del> <ins> if (!this.workspacesManagementMainService.isUntitledWorkspace(recent.workspace) && !this.containsWorkspace(workspaces, recent.workspace)) { </ins> workspaces.push(recent); } } // Folder else if (isRecentFolder(recent)) { <del> if (this.indexOfFolder(workspaces, recent.folderUri) === -1) { </del> <ins> if (!this.containsFolder(workspaces, recent.folderUri)) { </ins> workspaces.push(recent); } } // File else { <del> const alreadyExistsInHistory = this.indexOfFile(files, recent.fileUri) >= 0; </del> <ins> const alreadyExistsInHistory = this.containsFile(files, recent.fileUri); </ins> const shouldBeFiltered = recent.fileUri.scheme === Schemas.file && WorkspacesHistoryMainService.COMMON_FILES_FILTER.indexOf(basename(recent.fileUri)) >= 0; if (!alreadyExistsInHistory && !shouldBeFiltered) {

Related discussion:
text: <!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes/No Yes <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: 1.71.2 (user setup) OS: Windows_NT x64 10.0. CPU: i5- Run command and pick a invalid uri (e.g. path doesn't exist) when having "large" (like a few hundreds) amount of recent history entries, vscode will freeze for a few seconds !
By the way, having "large" amount of recent history entries will also slow down the start up time (both vscode start up and open file time) for a few seconds as well, just tested that with out any history with a few hundreds
thanks for testing that, do you recall how you got into this state of having many entries? Just by opening folders and files that contribute to the history? If you could do me a favor: open the command palette run the command "Log Storage Database Contents" run command "Toggle Developer Tools" click on "Console" expand the first "Storage..." output that is printed there find the entry (see picture below) how many entries do you see? <img width="1005" alt="image" src="https://user-"
Total of 671 entries, most of them are temp files opened from things like MobaXterm and !
Got it, we do have a limit of 500 entries when presented, but I still have to understand the performance issue. You could actually help out by doing a performance trace yourself when this happens by starting performance tracing before invoking the time consuming action and stopping right after.