Hi
I don’t have any experience with this, how can we use SSE features to improve the performance by processing both channels separately? FloatVectorOperations?
I couldn’t find any examples of using FloatVectorOperations in action. How do you do it for instance in the following example?
Maybe this might help.
This splits both channels and then you can do your processing in the while statement. Im doing this from my phone so it could be a crazy format.
const int totalNumChannels = getTotalNumInputChannels();
I seem to remember that to use the SSE features really effectively it helps to have your channel data in an interleaved format.
You can process a single channel effectively with FloatVectorOperations but not if you have time-varying parameters you’d like to apply smoothly. And unfortunately time-varying parameters are usually wanted.
Anyway - for what you have there you can apply the gain with:
FloatVectorOperations::multiply(buffer.getChannel(channel), GainParam, numSamples);
But as soon as you try to smooth the gain changes you’ll see what the problem is.
Also, if the next operation is with temp = abs(channelData[i]) then you’ll have a performance hit here I expect as you’ll need to reload the channelData[i] from the cache, whereas in your existing loop it’ll already be in a processor register from the previous line of code.
I have a simple compressor code, FL Studio shows 4%, i have the same code build with flowstone and its only 2%. I didn’t expect that. I created this topic to get some ideas how you’re doing dsp stuff to keep them cpu friendly.
In my case i have an envelope follower and few more lines which are being processed for each sample in the buffer.
Waiting for some insights.
Thanks for the reply. Yes I’m testing the release build, CPU usage is much lower than debug build. I haven’t used the profiler, I’m guessing that helps with finding the CPU hungry parts? let me see how it works before asking stupid questions.