Retarget HttpChannelParent::OnDataAvailable off-main-thread
Categories
(Core :: Networking, enhancement, P2)
Tracking
()
People
(Reporter: valentin, Assigned: smayya)
References
(Blocks 3 open bugs)
Details
(Whiteboard: [necko-triaged][necko-priority-queue])
Attachments
(1 file)
This would allow us to free up the main thread in the parent process.
To achieve this we need to:
- Make CacheFileOutputStream implement nsIThreadRetargetableStreamListener so that this check passes
- Make HttpChannelParent implement nsIThreadRetargetableStreamListener
- Make HttpChannelParent::OnDataAvailable thread safe - there's currently some flow control which suspends the channel. We need to handle that to allow off-main-thread diversion
- Retarget in HttpChannelParent::OnStartRequest
Comment 1•7 months ago
|
||
We've tried to do this before in bug 1505493, but we didn't see any improvements from the try push.
However, I think it's still worth to try again and see if we can make any difference.
Reporter | ||
Comment 2•7 months ago
|
||
Thank you for pointing that out. I completely forgot about it 🙂
Do you remember if we ever confirmed if retargetting actually happened? Because from what I can tell in https://phabricator.services.mozilla.com/D22516 we never implemented nsIThreadRetargetableStreamListener for CacheFileOutputStream, which means we would only retarget when reading from the cache, but not when writing to it (hot vs cold loads).
Anyway, I think our perf tooling might be a lot better now, both in CI and profiler.
I think it's worth trying again - for a simple pageload profile nsHttpChannel::OnDataAvailable occupies quite a big chunk of the flamegraph.
Reporter | ||
Updated•6 months ago
|
Assignee | ||
Updated•5 months ago
|
Assignee | ||
Comment 3•5 months ago
|
||
Comment 4•2 months ago
|
||
I'm rebasing this one to run it against the updated fenix applink tests.
Comment 5•2 months ago
|
||
The newssite
applink test is reporting low and medium regressions of ~40-50ms from this patch
I'll profile and make sure it's working as expected.
Description
•