Bug 218206

Summary: [Mac] Audio and Video element creation up to 300x slower than other browsers
Product: WebKit Reporter: Jer Noble <jer.noble>
Component: New BugsAssignee: Jer Noble <jer.noble>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, eric.carlson, ews-watchlist, glenn, jbedard, peng.liu6, philipj, rniwa, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
eric.carlson: review+
Patch for landing none

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].