On Thu, Mar 21, 2013 at 3:49 PM, Srikumar Subramanian
<srikumarks@gmail.com>wrote:
> For code like the granular synthesis example which creates tens of
> nodes or perhaps hundreds of nodes every second, I would expect the
> performance of the code to be determined by how early the nodes are
> released. If it is purely left to the GC to do this, I'm not sure the
> example would be viable with most JS engines. Would it be worth making
> implementation suggestions that would make this case performant
> without having to talk about GC and references?
>
Got a link to that example?
For an analogy, this case seems similar to whether a language spec
> should mandate tail call elimination. On one hand it is only an
> optimization. On the other its guaranteed presence leads devs to write
> very different code - perhaps using a lot of (mutual) recursion that
> would in a moment bomb an implementation that didn't support TCO.
> Python went the "nope" route and Scheme went the "yep" route. Both
> have their fans.
>
That's a fair point. Coming up with spec text for this seems hard but we
can probably work something out. It shouldn't affect audio output though,
just bound space usage. E.g. we could define "finished" nodes and specify
that the asymptotic space usage of the nodes of an AudioContext should be
O(N) in the number of non-finished nodes.
Rob
--
Wrfhf pnyyrq gurz gbtrgure naq fnvq, “Lbh xabj gung gur ehyref bs gur
Tragvyrf ybeq vg bire gurz, naq gurve uvtu bssvpvnyf rkrepvfr nhgubevgl
bire gurz. Abg fb jvgu lbh. Vafgrnq, jubrire jnagf gb orpbzr terng nzbat
lbh zhfg or lbhe freinag, naq jubrire jnagf gb or svefg zhfg or lbhe fynir
— whfg nf gur Fba bs Zna qvq abg pbzr gb or freirq, ohg gb freir, naq gb
tvir uvf yvsr nf n enafbz sbe znal.” [Znggurj 20:25-28]