Stop using a worker to write session restore information
Categories
(Firefox :: Session Restore, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox100 | --- | fixed |
People
(Reporter: Gijs, Assigned: mathew.hodson)
References
(Blocks 1 open bug)
Details
(Keywords: perf, perf:frontend, perf:startup)
Attachments
(1 file)
Writes to session restore currently happen from SessionWorker.js, which is loaded as a worker from SessionWorker.jsm.
After bug 1649605, the worker is using IOUtils to write async (ie it's not writing on the worker thread, but on a background thread).
It also has a mechanism to ensure only 1 pending IOUtils operation is happening at a given time.
At this point, given we don't do the writes on the worker thread, the worker is just overhead. That overhead manifests itself as time spent serializing to post to the worker, then deserializing, then serializing to JSON again, to finally do the write.
That means we could reduce the serialization overhead by a factor 3 by just getting rid of the worker. We should be able to fold the SessionWorker.js stuff into SessionWorker.jsm pretty straightforwardly, and then maybe rename to SessionWriter or similar to avoid confusion. This will also get rid of any startup costs associated with creating a DOM worker to do the write IO. We could in future perhaps enable more optimization if we could somehow memcpy
or w/e the JS object writeJSON
gets passed and do the serialization off-mainthread, but this would be a nice start...
Comment 1•2 years ago
|
||
This seems like a juicy opportunity. I agree that finding a way of transferring the JS object to the IOUtils thread rather than doing the serialization/deserialization, would be really really nice - would help us side step bug 1546847.
Assignee | ||
Comment 2•2 years ago
|
||
Updated•2 years ago
|
Comment 3•2 years ago
|
||
The severity field is not set for this bug.
:dao, could you have a look please?
For more information, please visit auto_nag documentation.
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2a8633af0279 Stop using a worker to write session store. r=Gijs,Standard8
Comment 5•2 years ago
|
||
bugherder |
Reporter | ||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Description
•