ffAudio / ff_meters

Plug and play component to display LED meters for JUCE audio buffers
BSD 3-Clause "New" or "Revised" License
113 stars 31 forks source link

Performance issue on Mac mini M1 but not on Windows10/11 #22

Open Mitchco opened 1 year ago

Mitchco commented 1 year ago

Thank you for ff_meters! I am using it in a multichannel plugin. On Windows 10/11, performance is top notch.

But on the Mac OS Monterey 12.5 and Juce 6.16, I seem to be getting excessive CPU utilization.

On Windows10/11 with the plugin loaded in AudioPluginHost and with the UI showing with the meters, I am getting approximately 4% CPU utilization. On MacOS under the same scenario, I am getting 40% CPU utilization.

I tried JUCE_COREGRAPHICS_DRAW_ASYNC=1 and that saved a few percent CPU cycles.

If I comment out meterSource.resize (juce::jmax(2, getTotalNumInputChannels()), 0.01 * sampleRate / 512); in prepareToPlay and comment out meterSource.measureBlock (buffer); in procesBlock then the CPU drops to 18% with the UI open. The meters appear to add ~20% CPU utilization on the Mac.

Maybe I am doing something wrong?