How many children/values can ValueTree reasonably hold?

I was considering using a value tree to store some file information that I need to save and load. I essentially want to ‘catalogue’ a bunch of audio samples with some information about the file. This could potentially lead to a tree having 10’s of thousands of children.
Not sure if this is a good idea, if Value tree can efficiently handle that many children, and or if there is a better structure type to use for this.

And side question; does Valuetree save children names as a hash and do like a hash lookup for functions like ValueTree::getChildWithName() ?

The Nodes and Properties are stored in simple juce::Arrays, so there is no concern about space except your memory. The overhead should be minimal.

Looking up an Identifier is done via a juce::StringPool:

The docs for juce::Identifier states:

Comparing two Identifier objects is very fast (an O(1) operation), but creating them can be slower than just using a String directly, so the optimal way to use them is to keep some static Identifier objects for the things you use often.

However, e.g. getChildWithProperty will have to compare the juce::var, so it is relatively slow (but there is probably no better generic way):

1 Like