Re:Using Firefox for a faster, calmer and distraction-free i...
by weaksauce on Sunday November 10, 2019 @06:57PM
(#21501045)
so i did a little bit of digging into it and it looks like it does a delete command for each of the items that are selected in the list separately. this is all overly simplified as there are other things going on (selecting the nodes to be deleted as well as notifications to other subsystems.)
That item can be a node(website) that has thousands of visits associated with it so it needs to then delete each of those in multiple batches of delete statements chunked by the db variable limit(~100 or 1000 I think).
Then after that transaction sqlite rebuilds the indexes(17 by my count) on the database with those items missing.
then it does the next chunk and continues on in chunks until there are no more items to delete and then the next item that was selected begins the process again. there might also be a problem with redrawing the history list taking time away from the deletion itself too. it's tough to say exactly what the full bottleneck it but the chunking of the deletes like that looks like a culprit.
Re:Using Firefox for a faster, calmer and distraction-free i...
by reubenmorais on Sunday November 10, 2019 @04:38PM
(#21500337)
Firefox is deleting each entry individually. I tried to contribute a patch with a short-circuit when you select all and hit delete, but the places code was in the middle of a refactoring, and as always with browsers it was way more complicated than my patch, so it wasn't accepted.
I've not probed this deeply, but I have encountered it and can confirm it's a problem. To give an idea of the magnitude of the problem, deleting 10,000 history items can easily lock up Firefox for a full hour. I think but haven't confirmed that it might even be nonlinear. e.g. deleting 1,000 entries 10 times in a row seems faster than deleting 10,000 entries in one go.
I don't know what firefox is doing here, but it's badly broken.
(My places.sqlite is 55MB)