Open Bug 1952237 Opened 7 months ago Updated 2 months ago

Retarget HttpChannelParent::OnDataAvailable off-main-thread

Categories

(Core :: Networking, enhancement, P2)

enhancement
Points:
3

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

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.

See Also: → 1505493

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.

Points: --- → 3
Assignee: nobody → smayya
Whiteboard: [necko-triaged][necko-priority-next] → [necko-triaged][necko-priority-queue]

I'm rebasing this one to run it against the updated fenix applink tests.

The newssite applink test is reporting low and medium regressions of ~40-50ms from this patch

https://perf.compare/compare-results?baseRev=a26cd39c86f8acf373285c58553635a77e8dbd29&newRev=4ca172975c2a85708623b4712d6484d4a32eb1b6&baseRepo=try&newRepo=try&framework=15&filter_confidence=low%2Cmedium%2Chigh

I'll profile and make sure it's working as expected.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: