Closed Bug 1690495 Opened 3 years ago Closed 3 years ago

Avoid updating the bookmarks toolbar multiple times when removing bookmarks

Categories

(Firefox :: Bookmarks & History, defect, P3)

defect
Points:
2

Tracking

()

RESOLVED FIXED
87 Branch
Iteration:
87.2 - Feb 8 - Feb 21
Tracking Status
firefox87 --- fixed

People

(Reporter: standard8, Assigned: daisuke)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

Attachments

(1 file)

Batching of bookmark remove notifications is being added in bug 1607245.

I noticed that BookmarkingUI.handlePlacesEvents will not be very efficient. This is an existing issue, but we can resolve it now due to the added batching:

https://searchfox.org/mozilla-central/rev/b2433a832c250c55255e0ee37d05192d04f20427/browser/base/content/browser-places.js#2355-2358

We should use a flag for the this.maybeShowOtherBookmarksFolder(); call and only execute once after the loop.

Likewise this.updateEmptyToolbarMessage() should only be executed after the loop.

These are both functions which potentially end up with us executing SQL.

I don't think it is worth splitting out the this._updateStar(); that should only be called once per batch.

Whilst here we could also clean up this code to only happen in the following if statement when we're building the bookmarks button:

https://searchfox.org/mozilla-central/rev/b2433a832c250c55255e0ee37d05192d04f20427/browser/base/content/browser-places.js#2452-2453

Assignee: nobody → daisuke
Status: NEW → ASSIGNED
Iteration: --- → 87.2 - Feb 8 - Feb 21
Points: --- → 2
Pushed by dakatsuka.birchill@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7aebb6b02c84
Make bookmarks toolbar to batch update when addition/removal. r=Standard8
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: