Re: ScriptProcessorNode off the main thread (Was: Questioning the current direction of the Web Audio API)

On Fri, Oct 25, 2013 at 3:17 PM, Joseph Berkovitz <joe@noteflight.com>wrote:

> Here are some of the issues with off-the-shelf workers that I see:
>
> - Shared workers, while not having a per-node overhead problem, seem too
> global in scope. It feels as though we want different working storage for
> different nodes, even if they share the same script. Global communication
> between nodes would probably lead to bugs, not advantages.
>

> - If there is one Dedicated worker per node, it's likely that Dedicated
> workers will have to be created in great quantity since Web Audio in many
> use cases is a very node-intensive system. The setup overhead for dedicated
> workers may be too high.
>
> - Dedicated workers imply postMessage-style communication via a
> MessagePort, which suggests unnecessary communication overhead since we
> don't need to allow passing of arbitrary data structures between node
> workers and the rest of the environment. We can focus on audio events and
> their results.
>
> - Going forward, Web Audio workers do not even need to communicate with
> arbitrary other pieces of the browser environment. They only need to
> communicate with the machinery running the audio graph.
>
> So I suggest we at least consider a new flavor of Worker that is tailored
> for WebAudio, or else move to a distinct object altogether.
>

The question is whether building an alternative off-main-thread JS
execution context could offer significant advantages over building on
DedicatedWorker, such as lower overhead if you have a lot of them.
Personally I don't see any reason to believe that there would be much
benefit. Complex or slow Worker features simply shouldn't be used by
processing code. If they are used, it's unlikely to be any worse than
having the processing code go into an infinite loop, which we have to
handle anyway.

Rob
-- 
Jtehsauts  tshaei dS,o n" Wohfy  Mdaon  yhoaus  eanuttehrotraiitny  eovni
le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o  Whhei csha iids  teoa
stiheer :p atroa lsyazye,d  'mYaonu,r  "sGients  uapr,e  tfaokreg iyvoeunr,
'm aotr  atnod  sgaoy ,h o'mGee.t"  uTph eann dt hwea lmka'n?  gBoutt  uIp
waanndt  wyeonut  thoo mken.o w  *
*

Received on Friday, 25 October 2013 13:41:03 UTC