Use FrozenArray in AudioWorkletProcessor.process()
- Category
- Multimedia
- Type
- New or changed feature
- Status
- In development (Chrome In development)
- Intent stage
- None
Summary
Currently AudioWorkletProcessor.process() method passes its arguments as `sequence<sequence<Float32Array>>`. The Audio WG discovered that this forces the implementation to allocate memory every processing block causing audio rendering performance degradation over time due to the garbage collection. Per the recent resolution in Audio WG (see the spec link), the WG decided to use FrozenArray<FrozenArray<Float32Array>> instead of compound `sequence` to avoid redundant reallocation.
Standards & signals
- Specification: https://github.com/WebAudio/web-audio-api/issues/1933#issuecomment-616632754
- Firefox: Positive
- Safari: No signal
- Web developers: Strongly positive — Many developers complained the performance degradation problem of AudioWorklet due to the garbage collection. Also the negative impact from this change will be almost negligible because there's no functionality change.
- Tracking bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1086665
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=use-frozenarray-in-audioworkletprocessor-process
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Use%20FrozenArray%20in%20AudioWorkletProcessor.process()
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Use%20FrozenArray%20in%20AudioWorkletProcessor.process()
- Baseline status: https://webstatus.dev/?q=Use%20FrozenArray%20in%20AudioWorkletProcessor.process()