(Relatively) slow save times

Some of our beta testers have said that they are not happy with the longer wait times they now encounter when saving their projects using one of our new JUCE-based plugins. While the new plugins do have more parameters than the pre-JUCE ones, it is the use of XML that seems to be the issue here. Our old software streamed binary parameter values directly to the provided buffer, which is apparently much faster than the createXml() function used to save the data from our value tree state. Also involved to some extent is the fact that the tree must be copied before createXml() is called on the copy (to avoid changes while writing, I assume).

Now, as a developer and maintainer of software, I love the flexibility and ease of providing backwards-compatibility that XML provides as compared to pure binary data. But I’m wondering if anyone else has seen this kind of slowdown in saving their session state, and if there were any optimizations that eased the problem?

By the way, these users who have complained have in excess of 50 tracks, each with a copy of our plug-in on it, which is why any minor slowdown becomes an issue, taking 5-10 seconds at times to save their sessions. They have stated that they like to save all the time, and this kind of delay is extremely annoying.

Any thoughts/ideas? I’d hate to lose the XML flexibility and revert to our old methods of saving and loading data, but it may need to happen if there isn’t a way we can get better performance out of the XML method of saving data.

Thanks!

This is strange, we haven’t encountered this and some of our plugins have many parameters. We also use the AudioProcessorValueTreeState and its XML handling.

Have you run the plugin through a profiler? You might be able to attach something like Xcode’s time profiler to a DAW that has many copies of your plugin loaded and see what spikes when hitting save

1 Like

ValueTrees don’t need to be handled as Xml with the getStateInformation and setStateInformation calls. (They can also be saved and loaded as/from binary data.) I don’t really understand why the Juce examples and many users do it via Xml. The data is just a block of bytes for the host anyway, so what is the point of going into Xml and back?

AH, I found that it is NOT the writing of the XML that is the culprit! It is the encryption of the session data that we added that caused the slowdown. Without encryption, the time to save 50 tracks in Pro Tools is less than a second, compared with nearly 3 seconds for that same data when being encrypted. So… never mind! (And thanks!)

1 Like