All profiling was done under the same circumstances.
AudioKit SDK through CocoaPods is compiled with -0s (Fastest, Smallest) even for Debug builds, so in order to replicate, same had to be done with SynthOne.
For playback, I used a 3-Note held Chord with the sequencer activated to increase polyphony.
The sound is pretty much he same, because of identical sources for the algorithms.
In both modules tanh calculation is the most expensive operation, and it seems like the one in @PaulBatchelor s implementation is actually the cheapest available. Alternatives like vox_fasttanh (as discussed here) are in fact slower (but may lead to slightly better sound).
The slightly better CPU performance of this new filter is presumably because of fewer calculations for Cutoff/Resonance parameters on each sample and a less complex call-hierarchy (no calls to the kernel to access the SoundPipe Kernel).
@aure @analogcode @marcussatellite @PaulBatchelor feel free to play around with this. I'll leave it open for discussion whether we should merge this or not.
I've attached the Instruments Profiling results at the bottom.
@sieren I played around with this. As you pointed out, there is not a noticeable difference in sound. @analogcode It would be great if we could get a third set of ears on this before merging.
Posting this as an RFC.
Benchmarks
Compiler Settings & Benchmark Scenario
All profiling was done under the same circumstances. AudioKit SDK through CocoaPods is compiled with
-0s (Fastest, Smallest)
even for Debug builds, so in order to replicate, same had to be done with SynthOne.For playback, I used a 3-Note held Chord with the sequencer activated to increase polyphony.
CPU Usage
SoundPipe Moog Ladder: ~36-43% S1DSPMoogLadder: ~27-35%
Instruments
SoundPipe
S1DSPMoogLadder
Discussion
The sound is pretty much he same, because of identical sources for the algorithms. In both modules
tanh
calculation is the most expensive operation, and it seems like the one in @PaulBatchelor s implementation is actually the cheapest available. Alternatives likevox_fasttanh
(as discussed here) are in fact slower (but may lead to slightly better sound).The slightly better CPU performance of this new filter is presumably because of fewer calculations for Cutoff/Resonance parameters on each sample and a less complex call-hierarchy (no calls to the kernel to access the SoundPipe Kernel).
@aure @analogcode @marcussatellite @PaulBatchelor feel free to play around with this. I'll leave it open for discussion whether we should merge this or not. I've attached the Instruments Profiling results at the bottom.
1_old_2_new.trace.zip