I need to go back to the discussion on drawing performance. Let’s take one of the latest JUCE versions (5.4.2) and the AudioPluginHost sample project and really simple setup.
As you can see in this “idle” state, it’s consuming 4% of CPU as shown in XCode (when running the app out of the XCode the Activity Monitor is giving similar values). Now the best part comes. Let’s move with a mouse one of the unconnected objects (let it be the Audio Input - it won’t be obviously visible on the screenshot that I am actually moving it;)). CPU consumption goes up into values like 40% (it’s not a peak value, it’s constantly consuming that much when I am moving the object).
Things get even worse when moving some connected objects (requires bezier paths recalculation and redrawing) - CPU consumption goes up into 77%.
Please note I have tried this on 2 different PCs (MacBook Pro 4x2.2 GHz and MacBookAir 2x1.8 GHz) and got similar results (I have also tried on some iPad and its even worse going into 100% when moving objects). Both PCs not doing any other ‘hard’ tasks while testing this.
Now let me switch into some Windows PC (4x2.5 GHz) and take exactly the same project. In 'idle" (GUI not being updated) - ca 2%-3%, moving unconnected object - 9%, moving connected object with 3-4 connections - 15%. I can confirm I can see CPU consumption to be higher on all 4 cores so it’s definitely not that it’s using only 1 core and thats why showing smaller values.
While testing I forced the integrated GPU to be in use only on all PCs (Macs and Win). Screen resolutions were similar and movements where smooth (except of the iPad, but it’s some old 2012 3rd gen iPad so we can ignore that).
Well, I have read Graphics Performance: Windows vs. macOS but now it’s with the sample project and to be honest I don’t see too many options to optimise it. Also, why is it that huge difference between MacOSX and Windows?
Please also look from that perspective - 4x2.2 GHz and moving one ‘small’ 2D rectangle takes almost 50% of the CPU power? Of course when I move different objects (native OSX windows like Finder window which is far more complicated object than those form AudioPluginHost) the CPU consumption is increasing by 20% only.
Could be because of how MacOSX calculates the CPU consumption (but in that case why the power consumption is also significantly higher on MacOSX than on Windows while moving those objects?). Could it be because MacOSX decides to redraw more frequently (as it can see there is still a lot of free CPU power as the CPU is in idle state?) - if so, that would be really dumb, as movements are equally smooth on MacOSX and Windows (I haven’t measured ‘FPS’ so can tell only by looking at the screen).
I am definitely not blaming JUCE framework. I’m just curious if any explanation exists. Thanks in advance for any help on that and - of course - greetings goes to whole JUCE Team!