How would one implement a system which reports (to the user, not the developer) how much time each node in an AudioProcessorGraph is taking?
I can think of a few ways:
- Instrument each node with some code that records how long processing takes. Store that in an atomic variable for use in the message thread.
- Instrument the call to process each node, and send that data centrally to the message thread over a FIFO. This could ensure a profile is complete. Need to have a big enough FIFO to hold the profile data.
- Sampling. Use a separate thread to read an atomic variable indicating the current node being processed. Potentially this would have very little performance impact on the audio thread.