alefragnani / vscode-bookmarks

Bookmarks Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks
GNU General Public License v3.0
1.71k stars 163 forks source link

Bookmark explorer is slow with large-ish file #705

Open Ben-Voris opened 7 months ago

Ben-Voris commented 7 months ago

Environment/version

Steps to reproduce

  1. Open a large-ish file that has a reoccurring string that you can search for and then bookmark. I ran into this with a file that has 24 hits (the first on line 12 and the last on line 90200) in 90300 lines. The file is 5.5 MB.
  2. Find the string and bookmark the line.
  3. Add a bookmark. Make the BOOKMARKS EXPLORER visible.
  4. Repeat 2.

After adding a bookmark, the Bookmarks Explorer does not update for several seconds. Navigating to a bookmark from the Bookmarks Explorer takes 3 to 5 seconds.

Using Bookmarks: List is usually much faster.

Also, because a search for the string I'm bookmarking immediately comes up with the number of hits (the "x of y" next to the search string), I'm convinced the problem isn't with VS Code or the size of the file.

alefragnani commented 7 months ago

Hi @Ben-Voris ,

I have worked in the past with a few large files, but not that large, withing folders with thousands of files, but didn't notice any performace issue. I'll try to reproduce this scenario, in oder to replicate the issue, and find out the reason behind this performance issue.

About the comparation with Bookmarks: List commad, it will always be faster, compared with the Side Bar. Simply because the Side Bar displays the bookmarks from the entire folder, and the Bookmarks: List command does for the active file. A better comparation would be with the Bookmarks: List from All Files command instead.

Thanks in advance