Open trummerschlunk opened 1 year ago
I guess most of the CPU goes inside the DSP loop itself, because it contains a lot of code... I cannot comment too much on the Faust DSP code itself (not enough understanding of the implementation) but by following the Optimizing the code and Debugging the Code pages here:
Instructions complexity : Load = 6025 Store = 1037 Binop = 4136 [ { Int(&) = 108 } { Int(*) = 4 } { Int(+) = 25 } { Int(-) = 14 } { Int(<) = 3 } { Int(==) = 46 } { Int(>) = 16 } { Real(*) = 1727 } { Real(+) = 1214 } { Real(-) = 536 } { Real(/) = 363 } { Real(<) = 5 } { Real(>) = 75 } ] Mathop = 363 [ { expf = 1 } { fabsf = 37 } { log10f = 30 } { logf = 3 } { max_f = 116 } { max_i = 2 } { min_f = 35 } { mydsp_faustpower2_f = 65 } { powf = 38 } { sqrtf = 36 } ] Numbers = 2127 Declare = 1377 Cast = 42 Select = 202 Loop = 15
so a lot of math operations of each sample (and powf
, sqrtf
, log10f
...etc...). Using some fast-math versions of them could help maybe, using the -fm <file> --fast-math <file> use optimized versions of mathematical functions implemented in <file>, use 'faust/dsp/fastmath.cpp' when file is 'def'.
compilation option to replace the standard math ?
- Using some fast-math versions of them could help maybe, using the
-fm <file> --fast-math <file> use optimized versions of mathematical functions implemented in <file>, use 'faust/dsp/fastmath.cpp' when file is 'def'.
compilation option to replace the standard math ?
I tried this already, and results are unusable. Hard to tell exactly what breaks, we would need to split out the different blocks of processing and test 1 by 1. Can faust partially use the fastmath file for some code blocks while having the regular stuff on the rest?
- Using some fast-math versions of them could help maybe, using the
-fm <file> --fast-math <file> use optimized versions of mathematical functions implemented in <file>, use 'faust/dsp/fastmath.cpp' when file is 'def'.
compilation option to replace the standard math ?I tried this already, and results are unusable. Hard to tell exactly what breaks, we would need to split out the different blocks of processing and test 1 by 1. Can faust partially use the fastmath file for some code blocks while having the regular stuff on the rest?
Not really, -fm
is global for the entire DSP.
Did some quick tests here, disabling individual modules and seeing what would happen to the CPU load.
Can say with 100% confidence that mscomp_bp
is the heavy block on the whole chain.
I have a little embed PC that is able to run master_me with everything enabled except mscomp_bp
. Once I enable that the CPU goes way too high.
More specifically, it is the B_band_Compressor_N_chan
function that takes the most CPU.
If we can optimize that, the CPU usage of the plugin will become much more reasonable.
Thank you, @falkTX for testing! @magnetophon and @x42... Any ideas? I'll check the code too and see if I can find cheaper solutions. Happy 23 y'all!
Hi everyone,
hope you are doing fine. I recovered a bit from the last months of master_me ;) Meanwhile, I used it on several projects and I am very happy with the sound, the dsp design, the gui... Great work y'all!
The resonance on mastodon was quite impressive. People seem to want this :) And we did not even post on birdsite & co yet... https://chaos.social/web/@trummerschlunk/108927371163970570
On my M1 macbook pro, several instances run smoothly, but I guess, master_me needs a round of optimization regarding cpu usage - so I want to start this thread.
On the FAUST side Any ideas on how to make things more efficient here?
On the C++ side Can some parts, or even modules (like lufs metering) be coded more efficiently, using pure C++ code (from other open-source projects)? How much potential lies in this approach at all?
On the GUI side How about communication between FAUST generated code and GUI? Some issues are already discussed here: https://github.com/trummerschlunk/master_me/issues/66
Thank you for your contributions and ongoing support <3
Klaus