Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR]: Optimise Node Storage #173

Open
6 of 11 tasks
drowaudio opened this issue Jun 27, 2023 · 0 comments
Open
6 of 11 tasks

[FR]: Optimise Node Storage #173

drowaudio opened this issue Jun 27, 2023 · 0 comments

Comments

@drowaudio
Copy link
Contributor

drowaudio commented Jun 27, 2023

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.

  • TrackMutingNode [172] (saves 88,400B)
  • RackInstanceNode [80] (saves 73,840B) (use source buffers if single output)
  • ReturnNode [79] (saves 672,880B) (can disable allocation in prepare if there is valid input, otherwise it will be empty)
  • RackReturnNode [72] (saves 74,880B) (use source buffers if single output)
  • PluginNode [79] (saves 67,600B) (use source buffers if single output)
  • LevelMeasurerProcessingNode [21] (saves 21,840)
  • SummingNode [89]
  • FadeInOutNode

Other optimisations

  • SinkNode (can have a shared empty buffer and set this as the output)
  • ReturnNode [?] (can have a shared empty buffer and set this as the output)
  • Nodes receiving sink nodes and skip them to avoid adding silence
    N.B. The above could have problems if a Node tries to steal its buffer and write over it. We would need some mechanism for preventing this.
@drowaudio drowaudio linked a pull request Jul 12, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant