How to debug performance spikes in plugin

I get audio pops and clicks every second or so, with the DSP-meter in the host skyrocketing into the red. Now I’m looking for options to analyze the code. From what I’ve read the realtime CPU-time profiling in VisualStudio is only available from Win8 and up. (I’m on Win7 / Linux).

Is there some flag which is set if the buffer is not completed in time or some other point for me to find the malicious code piece?

I prefer to set up testing/benchmark harnesses for the DSP code independently of the plugin and use a tool like perf on Linux and there are tools like this for generating flame graphs from the output to identify your hot code paths.

That’s why I like using a separate testing harness for the DSP code, there’s less to sift through when you’re able to test it separately.

Once you identify the codepaths and you need to actually optimize stuff, microbenchmarks with something like google benchmark are very helpful.

Cool thanks for your answer. Writing performance tests for your modules individually seems to be an intriguing idea, and I think I will go through with this. However it seems to me this will be needed in a later stage of development / optimization. My problem right now seems to be related to turning knobs (didn’t mention it, my bad). Hence, profiling DSP code on its own will probably not do.

If anybody has more input on profiling the entirety of the plugin in a host it would be very welcome!