JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, LV2 and AAX audio plug-ins.
This PR introduces an optimization to the ValueTree::SharedObject::callListeners method, improving its performance by avoiding a valueTreesWithListeners.contains(v) call when valueTreesWithListeners is not modified by one of the listeners. Instead, valueTreesWithListeners[i] == v is checked before. It gives a significant speedup when numListeners is high.
Note that if i is out of bounds, a nullptr is returned by valueTreesWithListeners[i] and it will compare as not equal to v.
This change improved significantly the performance of preset loading at Minimal Audio (internally using juce::ValueTree::copyPropertiesAndChildrenFrom), so we share it back. See this PR description in our JUCE fork for some indicative benchmarks.
This PR introduces an optimization to the
ValueTree::SharedObject::callListeners
method, improving its performance by avoiding avalueTreesWithListeners.contains(v)
call whenvalueTreesWithListeners
is not modified by one of the listeners. Instead,valueTreesWithListeners[i] == v
is checked before. It gives a significant speedup whennumListeners
is high.Note that if
i
is out of bounds, anullptr
is returned byvalueTreesWithListeners[i]
and it will compare as not equal tov
.This change improved significantly the performance of preset loading at Minimal Audio (internally using
juce::ValueTree::copyPropertiesAndChildrenFrom
), so we share it back. See this PR description in our JUCE fork for some indicative benchmarks.