Closed
Bug 1668506
Opened 5 years ago
Closed 5 years ago
Use PBackground instead of PContent for syncing SessionStorage to reduce main thread parent process usage
Categories
(Core :: Storage: localStorage & sessionStorage, enhancement)
Core
Storage: localStorage & sessionStorage
Tracking
()
RESOLVED
DUPLICATE
of bug 1654080
People
(Reporter: tt, Assigned: tt)
References
Details
Attachments
(1 obsolete file)
No description provided.
| Assignee | ||
Comment 1•5 years ago
|
||
This patch does:
- Move IPC from PContent to PBackground (SessionStorageManager{Child, Parent}).
- Change
SessionStorageManagerandBrowsingContext's relationship. - Expose a getter function to get a manager for top context id on the parent.
- Make SessionStorageManagerParent maintain (originAttrs, originKeys) table. So
that we don't need to traverse whole originRecord table in manager while it's
destoryed.
Follow-up work:
- Maybe write SSCache in to disk if it's not loaded after a certain time rather
than keeping it as in-memory objects until shuting down.
IPC
- Before this patch:
- Copy from parent while loading a document.
- Mark cache entry on the parent process as loaded by the child id.
- Update change on checkpoint.
- Unmark cache entry on the parent process as unloaded for the child id while
the parent actor is destorying.
- Copy from parent while loading a document.
- After this patch:
- Sync IPC load in the first SessionStorage operation.
- Mark cache entry on the parent process as loaded by the parent actor
pointer.
- Mark cache entry on the parent process as loaded by the parent actor
- Update change on checkpoint
- Unmark cache entry on the parent process as loaded by the parent actor
pointer while parent actor is destorying.
- Sync IPC load in the first SessionStorage operation.
SessionStorageManager's lifecycle on the parent process.
- Before this patch:
- Lives on the main thread
- Create a cycle for
SessionStorageManagerandBrowsingContextpair (bc is
also held bySessionStorageManager) while a content process shutdowns. - IIUC, destory during the parent process shutdowns (CC)
- After this patch:
- On the parent process, lives on the background thread.
- Create
SessionStorageManagerthat held by static global mananger list
sManagers. - Destory on the background thread after receiving profile-before-change
topic. - Note that there are
SessionStorageManagerthat live on the main thread.
However their sessionStorages are not used and thus are not registered on
the manager list.
| Assignee | ||
Updated•5 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 2•5 years ago
•
|
||
Updated•5 years ago
|
Attachment #9179506 -
Attachment is obsolete: true
| Assignee | ||
Comment 3•5 years ago
|
||
Discussed with Jan and we decided to fold the remaining patches together to make it easier to be review.
| Assignee | ||
Comment 4•5 years ago
|
||
try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=d9525d322f74bd1323a22365f8da82a72809dc2c
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
| Assignee | ||
Updated•5 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Assignee | ||
Comment 5•5 years ago
•
|
||
| Assignee | ||
Comment 6•5 years ago
|
||
| Assignee | ||
Comment 7•5 years ago
|
||
| Assignee | ||
Comment 8•5 years ago
|
||
| Assignee | ||
Comment 9•5 years ago
|
||
| Assignee | ||
Comment 10•5 years ago
|
||
The patch has been merged to bug 1654080.
Status: REOPENED → RESOLVED
Closed: 5 years ago → 5 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•