You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
auto get_samples_mono = [csample, this] (uint x, auto& fsamples)
Have you investigated how for instance gcc or clang treats this code? Because the code is very nice, and if compilers can guarantee that everything is inlined (and no heap allocations occur), I'll probably start using local lambdas too in realtime critical code.
The text was updated successfully, but these errors were encountered:
As far as I know, a lambda like this is not much more than a class with a few data members (captured variables) and one single method that is called when the lambda is called, so the compiler should inline it as far as I know. But I didn't do systematic benchmarking. So if you do and have results I'd be interested to hear what you found.
Also note that this is not the final optimized variant. To produce a final optimized variant all features must be there, and this code is only doing linear interpolation where it should do higher order sinc interpolation. So although I measured that this isn't slow, full optimization will have to wait until sinc interpolation is implemented.
Hi, I looked through your code and saw this:
liquidsfz/lib/voice.cc
Line 309 in 74eacc5
Have you investigated how for instance gcc or clang treats this code? Because the code is very nice, and if compilers can guarantee that everything is inlined (and no heap allocations occur), I'll probably start using local lambdas too in realtime critical code.
The text was updated successfully, but these errors were encountered: