Search code examples
performanceprofilingsignal-processingcpu-usagepuredata

Profile CPU Usage of DSP objects in Realtime


Description

Our Application is based of DSP synthesizer mostly used to create music, written in C Language, and I want to create a system-wide feature to give visual feedback to the user so they can find out which DSP objects are the most CPU-hungry.

I researched a lot but I can't find a way to do implement this feature.

Can anyone guide me how can I implement this feature?

I just want someone to point me in the right direction!!

Thanks in Advance

I have tried to understand how Windows Task Manager works and how ps command in Linux works...

I also looked into Win32API but they all just show currently running processes, and My task is to find the CPU usage of DSP objects currently in use...

my naive approach would involve counting CPU cycles in each method of the object, but I have no idea if thats even the right place to start thinking about it


Solution

  • how about this: measure the time each block takes to do its thing?

    the scheduler calls each perform-routine in the DSP graph. so you just need to measure the time it takes for the perform-routine to return. the longer it takes, the more CPU-hungry the object is (eventually scale the values by the block size)