Closed kmatheussen closed 10 months ago
Yes indeed, heavy code even with LLVM.
I guess I should have written how much worse it is. On an M3 macbook, this instrument uses around 2% CPU for LLVM, and around 80% CPU for the interpreter. The interpreter is using a lot more CPU than usual. Usually the interpreter is maybe 3-4X slower, for this instrument it's around 40X slower.
Maybe the interpreter is getting exponentially slower compared to LLVM the bigger the instruments are?
I guess a more probable reason is that various overhead make it seem like there is a low difference in CPU between LLVM and interpreter for lighter instruments, while for heavier instruments the difference in performance between LLVM and the interpreter is much more notable.
On Intel 2,2 GHz Intel Core i7:
faustbench-llvm-interp radium.dsp Libfaust version : 2.70.3 (LLVM 16.0.2) DSP inputs = 0 outputs = 2 Duration 0.566683 Duration 26.618201 Result LLVM : 14.1065 Interpreter : 0.311295 ratio : 45.3155
On M1: Libfaust version : 2.70.3 (LLVM 18.0.0git) DSP inputs = 0 outputs = 2 Duration 0.257206 Duration 12.439307 Result LLVM : 31.5661 Interpreter : 0.655039 ratio : 48.1896
Maybe overall cache-usage can explain the bigger difference I saw in Radium. Anyway, I guess this type of difference in performance is common... I just had gotten the wrong impression of the efficiency of the interpreter because I hadn't thought about the baseline overhead when measuring CPU usage for instruments in Radium.
And a possible complementary explanation is that LLVM auto-vectorisation (so generating SIMD code) seems to be improved with recent versions, so raising the LLVM/Interp ratio.
Tested Faust version: 2.54.9 Sorry for the noise if this has been fixed in newer version of Faust.
Steps to reproduce:
Ref: https://github.com/kmatheussen/radium/pull/1410
Or: Try this instrument: