Bug 226644

Summary: Avoid wasteful large allocation in SpeechRecognitionRemoteRealtimeMediaSource::setStorage()
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: MediaAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: eric.carlson, ews-watchlist, glenn, jer.noble, peng.liu6, philipj, rbuis, sergio, sihui_liu, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=226253
Attachments:
Description Flags
Patch none

Description Chris Dumez 2021-06-04 08:41:58 PDT
Avoid wasteful large allocation in SpeechRecognitionRemoteRealtimeMediaSource::setStorage().
setStorage() sets m_buffer's size to the same size as the RingBuffer (2*sampleRate), only to resize it to the size of the rendering quantum (512) later in SpeechRecognitionRemoteRealtimeMediaSource::remoteAudioSamplesAvailable().
Comment 1 Chris Dumez 2021-06-04 08:43:48 PDT
Created attachment 430582 [details]
Patch
Comment 2 EWS 2021-06-04 10:14:31 PDT
Committed r278471 (238489@main): <https://commits.webkit.org/238489@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 430582 [details].
Comment 3 Radar WebKit Bug Importer 2021-06-04 10:15:21 PDT
<rdar://problem/78874517>