Closed Bug 1451352 Opened 6 years ago Closed 6 years ago

Improve performance of copying bookmarks (via copy/paste or drag/drop)

Categories

(Firefox :: Bookmarks & History, enhancement, P1)

enhancement

Tracking

()

RESOLVED WONTFIX

People

(Reporter: standard8, Assigned: standard8)

References

Details

(Whiteboard: [fxsearch])

Attachments

(1 file)

Splitting this out from bug 1404909 as recent changes makes it easier for us to deal with copy & move separately.

We should be able to improve the performance of copying multiple bookmarks.

Currently, we create a transaction for each individual bookmark in the copy, and then execute those transactions.

If we create a new PlacesTransaction, e.g. InsertTree, then we can create an object tree of the items to insert, and insert them all in one go.

This allows us to use database insert optimisations of insertTree, rather than individual insert operations.

Once we can redo notifications, we'll get further gains there.
Comment on attachment 8964935 [details]
Bug 1451352 - Rework copying bookmarks (via paste or dnd) to use insertTree to improve performance.

This largely works for copies from urlbar / tabs / external instances.

I'd like some feedback on the general architecture before I go further.

To finish it, I need a version of promiseBookmarksTree that returns items that are in a suitable format to push to insertTree, or do some kind of translation.

I'm thinking that the optimal way would be to implement PU.bookmarks.fetchTree().

Comments welcome.
Attachment #8964935 - Flags: feedback?(mak77)
Comment on attachment 8964935 [details]
Bug 1451352 - Rework copying bookmarks (via paste or dnd) to use insertTree to improve performance.

I'd have nothing against introducing an insertTree transaction....
But I have a couple concerns:
1. I wonder if it may be less efficient in the single/few insert case, that may be the most common one. Then we'd need to complicate the code to take different paths.
2. How common is copying multiple bookmarks? I suspect it's far more common to "move" them, and the copy today happens mostly because we don't allow moving from bookmark queries, that is something we want to change, to reduce the likelihood for the user to create dupes.

And based on the above questions, is it worth to add this complication for a possibly uncommon operation?
Attachment #8964935 - Flags: feedback?(mak77)
I think you're probably right, that this isn't worth the complication at this stage. I'm still a little concerned about performance there, as we won't be able to get batch updates for the UI easily, but lets park this for now, and see what happens once we've finished the other changes we're working on.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: