WebAssembly 对 AudioWorklet 的优势
Advantages of WebAssembly for AudioWorklet
引自这篇文章:https://developers.google.com/web/updates/2018/06/audio-worklet-design-pattern
WebAssembly is a perfect companion for AudioWorkletProcessor. The combination of these two features brings a variety of advantages to audio processing on the web, but the two biggest benefits are: a) bringing existing C/C++ audio processing code into the WebAudio ecosystem and b) avoiding the overhead of JS JIT compilation and garbage collection in the audio processing code.
我想知道使用 WebAssembly 的实际优势在哪里。 WebAssembly 是否完全避免了垃圾收集?这是否超过了 WebAssembly 与原生相比的性能损失 Javascript?
Does WebAssembly avoid garbage collection altogether?
正确,WebAssembly 没有垃圾收集器。 WebAssembly 本身就是一个编译目标,这也是为什么目前最直接将非垃圾收集语言编译成 WebAssembly 的原因,例如 C/C++、Rust、Go。
Does this outweigh the performance hit that WebAssembly has compared to native Javascript?
不确定你的意思是什么? WebAssembly 比 JavaScript 等效的执行速度更快,更可预测,加载速度更快。例如,查看 WebAssembly 如何使 sourcemap 算法快约 3 倍:
WebAssembly 特别适合算法代码 - 这就是为什么它非常适合音频处理。
引自这篇文章:https://developers.google.com/web/updates/2018/06/audio-worklet-design-pattern
WebAssembly is a perfect companion for AudioWorkletProcessor. The combination of these two features brings a variety of advantages to audio processing on the web, but the two biggest benefits are: a) bringing existing C/C++ audio processing code into the WebAudio ecosystem and b) avoiding the overhead of JS JIT compilation and garbage collection in the audio processing code.
我想知道使用 WebAssembly 的实际优势在哪里。 WebAssembly 是否完全避免了垃圾收集?这是否超过了 WebAssembly 与原生相比的性能损失 Javascript?
Does WebAssembly avoid garbage collection altogether?
正确,WebAssembly 没有垃圾收集器。 WebAssembly 本身就是一个编译目标,这也是为什么目前最直接将非垃圾收集语言编译成 WebAssembly 的原因,例如 C/C++、Rust、Go。
Does this outweigh the performance hit that WebAssembly has compared to native Javascript?
不确定你的意思是什么? WebAssembly 比 JavaScript 等效的执行速度更快,更可预测,加载速度更快。例如,查看 WebAssembly 如何使 sourcemap 算法快约 3 倍:
WebAssembly 特别适合算法代码 - 这就是为什么它非常适合音频处理。