Looking at the profile and the Juce code, I see some things I don't like:
juce_RectangleList.cpp- Code: Select all
Rectangle<int> RectangleList::getRectangle (const int index) const noexcept
{
if (isPositiveAndBelow (index, rects.size()))
return rects.getReference (index);
return Rectangle<int>();
}
Say what? Every call to getRectangle() is bounds-tested?
The prominence of
RectangleList::subtract probably has to do with
EdgeTableRegion::clipToRectangleList. Obviously the run time of
clipToRectangleList() is linear with the number of rectangles and we're paying for that ridiculous
isPositiveAndBelow which is totally unnecessary. Going from 60 to 30 rectangles in the rectangle list will cut the number of calls to clipToRectangleList() exactly in half, consistent with your observation of performPendingRepaintsNow() behavior.
It looks like Jules has some profiling to do, after all of the changes to rendering some hot spots have reared their ugly head again!