IDB: Replace array with linked list in DatabaseActorInfo to speed up live database handling
Categories
(Core :: Storage: IndexedDB, task, P3)
Tracking
()
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.
Assignee | ||
Comment 1•17 days ago
|
||
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.
Updated•15 days ago
|
Updated•15 days ago
|
Comment 3•15 days ago
|
||
bugherder |
Comment 4•9 days ago
|
||
(In reply to Cosmin Sabou [:CosminS] from comment #3)
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.
Description
•