Closed Bug 1964400 Opened 17 days ago Closed 15 days ago

IDB: Replace array with linked list in DatabaseActorInfo to speed up live database handling

Categories

(Core :: Storage: IndexedDB, task, P3)

task

Tracking

()

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: janv, Assigned: janv)

References

(Blocks 1 open bug)

Details

(Keywords: perf-alert)

Attachments

(1 file)

To improve performance in scenarios with frequent database open/close operations, we plan to replace the mLiveDatabases array member in the DatabaseActorInfo class with a linked list.

mLiveDatabases tracks the live Database instances. Under heavy usage patterns, such as closing many database objects at once, the array incurs unnecessary overhead during removal operations. By switching to a linked list, we can achieve more efficient removal while preserving the insertion order of live database entries, a key requirement that prevents us from using unordered structures like hash sets.

This work is part of the broader effort tracked in the meta bug to reduce jank and improve responsiveness when many IndexedDB databases are opened/closed frequently.

Replaces the mLiveDatabases array in DatabaseActorInfo with a linked list to
improve performance during live database tracking.

This change improves performance in scenarios where many databases are closed
in quick succession. The array previously used for tracking live Database
instances incurred linear-time removal overhead, which the linked list avoids.
Unlike a hash set, the linked list preserves insertion order, which is required
for correctness.

This is part of the ongoing effort to reduce jank caused by frequent IndexedDB
open/close activity, tracked in the associated meta bug.

See Also: → 1964967
See Also: → 1964969
Attachment #9485523 - Attachment description: Bug 1964400 - IDB: Replace array with linked list in DatabaseActorInfo to speed up live database handling; r=#dom-storage → Bug 1964400 - IDB: Replace array with linked list in DatabaseActorInfo to speed up live database handling; r=#dom-storage,jstutte
Attachment #9485523 - Attachment description: Bug 1964400 - IDB: Replace array with linked list in DatabaseActorInfo to speed up live database handling; r=#dom-storage,jstutte → Bug 1964400 - IDB: Replace array with linked list in DatabaseActorInfo to speed up live database handling; r=#dom-storage
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/319fec9f5532 IDB: Replace array with linked list in DatabaseActorInfo to speed up live database handling; r=dom-storage-reviewers,jstutte
Status: ASSIGNED → RESOLVED
Closed: 15 days ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch
See Also: 1964967

(In reply to Cosmin Sabou [:CosminS] from comment #3)

https://hg.mozilla.org/mozilla-central/rev/319fec9f5532

Perfherder has detected a browsertime performance change from push 319fec9f55327455ee76eb998c9f1345361d8f37.

If you have any questions, please reach out to a performance sheriff. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.

Improvements:

Ratio Test Platform Options Absolute values (old vs new) Performance Profiles
100% idb-open-many-par delete_duration linux1804-64-shippable-qr fission webrender 21,844.88 -> 1.26 Before/After
100% idb-open-many-par delete_duration macosx1470-64-shippable fission webrender 14,828.68 -> 1.76 Before/After
100% idb-open-many-seq delete_duration linux1804-64-shippable-qr fission webrender 22,189.87 -> 1.17 Before/After
100% idb-open-many-seq delete_duration macosx1470-64-shippable fission webrender 13,807.98 -> 1.67 Before/After
100% idb-open-many-par delete_duration windows11-64-24h2-shippable fission webrender 7,334.63 -> 3.93 Before/After
... ... ... ... ... ...
17% idb-open-few-par time_duration linux1804-64-shippable-qr fission webrender 1,229.52 -> 1,023.95 Before/After

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a performance sheriff to do that for you.

You can run all of these tests on try with ./mach try perf --alert 45133

The following documentation link provides more information about this command.

Keywords: perf-alert
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: