Tracktion / tracktion_engine

Tracktion Engine module
Other
1.2k stars 152 forks source link

[FR]: Optimise Node Storage #173

Open drowaudio opened 1 year ago

drowaudio commented 1 year ago

In some places, Nodes will be part of a straight chain. In these places, if no other Node is dependant on the input, a Node can simply use the input Node's buffer. In order to do this, we can check in prepareToPlay if any Nodes in the graph reference input and if not, set the optimisations to "don't allocate". We can then get the source buffer in process and call setAudioOutput instead of filling it.

This is in place in some locations already but the above is an addition that should make it unnecessary to even allocate the memory in the first place.

Other optimisations