Hi Jules and everyone, I've attached a version of the AudioProcessorGraph source file with a new method for sorting nodes and made modifications to the calculator code accordingly. On my machine (i7-3770k) I can process around 5000 nodes with about 10,000 connections in roughly 35ms. With my graph arrangement (basic DAW layout) that roughly equates to about 350 tracks with 6 inserts per. It's much faster than I need it to be.
I've attached the code for anyone that would like to give it a test. If anyone has any feedback on the approach or C++'ness of the code it would be greatly appreciated.
Jules if you're interested in using this code in the library, or parts of it or whatever, please feel free.
- I'm not a performance guru. Some information is cached and the sorting routine is reasonable. No fancy tricks.
- Tested fairly well with a number of branching configurations. Latencies, detecting feedback loops (sorry still not supported), comparisons of stock calculator statistics. Generally produces the same output as the stock graph. It has a strict sorting routine so there are times when it produces very slightly leaner output. It does a bit worse if you have a node with no connections as it adds them at the beginning vs typically the end with the stock graph. That said, variances on either side appear to be negligible.
- No changes to external apis or structures
- New class GraphMap replaces the ConnectionLookupTable
- New classes MapNode and MapNodeConnection tie Node and Connection information together
- RenderingOpsSequenceCalculator::createRenderingOpsForNode is modified to work with MapNodes and MapNodeConnections and now has an internal struct called ChannelBufferInfo to facilitate the buffer reuse list.
- Feedback loops are still not supported
That's about all I can think of at the moment. Please feel free to give it a try, you should be able to just drop it into your code base with no changes required.