Bug 218206 - [Mac] Audio and Video element creation up to 300x slower than other browsers
Summary: [Mac] Audio and Video element creation up to 300x slower than other browsers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-10-26 14:07 PDT by Jer Noble
Modified: 2020-10-27 15:21 PDT (History)
10 users (show)

See Also:


Attachments
Patch (15.99 KB, patch)
2020-10-26 14:17 PDT, Jer Noble
eric.carlson: review+
Details | Formatted Diff | Diff
Patch for landing (15.99 KB, patch)
2020-10-27 10:03 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 2020-10-26 14:07:52 PDT
[Mac] Audio and Video element creation up to 300x slower than other browsers
Comment 1 Jer Noble 2020-10-26 14:08:26 PDT
<rdar://problem/62451019>
Comment 2 Jer Noble 2020-10-26 14:17:18 PDT
Created attachment 412353 [details]
Patch
Comment 3 Eric Carlson 2020-10-26 14:30:34 PDT
Comment on attachment 412353 [details]
Patch

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

> Source/WebCore/platform/audio/mac/AudioSessionMac.mm:104
> +    bool hasSampleRateObserver { false };
> +    Optional<double> sampleRate;
> +    bool hasBufferSizeObserver { false };
> +    Optional<size_t> bufferSize;

Nit: the object would be slightly smaller if the `Optional<size_t>` were declared above the bools
Comment 4 Peng Liu 2020-10-26 14:38:51 PDT
Comment on attachment 412353 [details]
Patch

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

> Source/WebCore/platform/audio/mac/AudioSessionMac.mm:128
> +    if (result)

Nit. Probably "if (result != noErr)" is better?

> Source/WebCore/platform/audio/mac/AudioSessionMac.mm:409
> +    if (!result)

Nit. Probably "if (result == noErr)" is better?
Comment 5 Jer Noble 2020-10-27 10:03:16 PDT
Created attachment 412437 [details]
Patch for landing
Comment 6 EWS 2020-10-27 15:21:33 PDT
Committed r269077: <https://trac.webkit.org/changeset/269077>

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