eric-bixby / auto-sort-bookmarks-webext

Firefox add-on to sort bookmarks by multiple criteria
GNU General Public License v3.0
112 stars 20 forks source link

Auto Sort is slow on huge boomark set (restore delta sort) #108

Open Morikko opened 2 years ago

Morikko commented 2 years ago

If the auto sort function is on then any change on the bookmark is getting really slow.

Based on the code, I suspect that it sorts all the bookmark all the time and it takes seconds for my set.

I do not know the API by heart but I suspect that it should be possible to know which bookmark changed (CUD) and to sort only the changed bookmark folder level.

Note: I would even think that a delete should not require a sort as the elements were already sorted.

eric-bixby commented 2 years ago

Originally, that's how Auto-Sort Bookmarks (ASB) worked. The problem was there are edge cases where bookmarks would not get sorted, so logic was added but this didn't always work and caused other problems (like corruption). For the sake of simplicity and stability, it does a delayed sort (wait for no activity, then sort). I had planned to restore the delta sort, but haven't gotten around to it yet.

Gitoffthelawn commented 2 years ago

Of course, continuing to prevent corruption needs to be of the highest priority!