Bug 229813 - Buffer large media XHRs in the NetworkProcess to reduce IPC overhead
Summary: Buffer large media XHRs in the NetworkProcess to reduce IPC overhead
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-02 09:37 PDT by Jer Noble
Modified: 2021-09-03 09:41 PDT (History)
5 users (show)

See Also:


Attachments
Patch (6.21 KB, patch)
2021-09-02 12:13 PDT, Jer Noble
achristensen: review+
achristensen: commit-queue-
Details | Formatted Diff | Diff
Patch for landing (6.61 KB, patch)
2021-09-02 12:31 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (6.86 KB, patch)
2021-09-02 14:21 PDT, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2021-09-02 09:37:50 PDT
Buffer large media XHRs in the NetworkProcess to reduce IPC overhead
Comment 1 Jer Noble 2021-09-02 09:38:31 PDT
<rdar://82406803>
Comment 2 Jer Noble 2021-09-02 12:13:37 PDT
Created attachment 437180 [details]
Patch
Comment 3 Peng Liu 2021-09-02 12:26:28 PDT
Comment on attachment 437180 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=437180&action=review

> Source/WebKit/WebProcess/Network/WebLoaderStrategy.h:94
> +    static constexpr Seconds mediaMaximumBufferingTime { 50_s };

50_s?
Comment 4 Alex Christensen 2021-09-02 12:26:34 PDT
Comment on attachment 437180 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=437180&action=review

> Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:652
> +        && m_response.expectedContentLength() > static_cast<long long>(1 * MB)

I would put this check before isMediaMIMEType because it's a cheap integer comparison that's likely to fail.

> Source/WebKit/NetworkProcess/NetworkResourceLoader.h:213
> +    NetworkResourceLoadParameters m_parameters;

I think it would be better to mark maximumBufferingTime as mutable rather than all the parameters as non-const.
Comment 5 Jer Noble 2021-09-02 12:29:17 PDT
(In reply to Peng Liu from comment #3)
> Comment on attachment 437180 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=437180&action=review
> 
> > Source/WebKit/WebProcess/Network/WebLoaderStrategy.h:94
> > +    static constexpr Seconds mediaMaximumBufferingTime { 50_s };
> 
> 50_s?

OMG. Nice catch.
Comment 6 Jer Noble 2021-09-02 12:31:10 PDT
Created attachment 437182 [details]
Patch for landing
Comment 7 Jer Noble 2021-09-02 14:21:43 PDT
Created attachment 437198 [details]
Patch for landing
Comment 8 EWS 2021-09-03 09:41:13 PDT
Committed r282003 (241310@main): <https://commits.webkit.org/241310@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 437198 [details].