Reducing preset data size



Usually I store plugin data as XML.

My current project needs to handle/store lots of data.
And preset size becomes around 400 to 500KB.
I think it’s bit too big for a single preset.
So I want to reduce data size of it.

Are there any good way for this?

Thank you


You can keep all your code as it is and save the ValueTree in binary form, using ValueTree::writeToStream() (saves already a lot).

If you want to look outside JUCE, have a look at Google’s Protocol-Buffers, they are very optimised, provide implementations for many platforms and you can define the structure to it without creating overhead (haven’t used it yet, but would be my first choice).

Third method, wrapping your XML in a zipped file… (the least appealing IMHO).



Thank you I will check those.
Especially Protocol Buffers looks very nice for reducing data size.