-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimizing fluid_synth_write functions #571
Comments
Moving that
For curiosity, which platforms, pls.? |
ARM Cortex M4, with single precision FPU, 120MHz, 8MB RAM. |
Oh, right, I remember. That thing doesn't have branch prediction, right? In this case, you might also be interested in #569. Btw, do you have chorus activated when using fluidsynth on that platform? |
Yes, I deactivated many things. |
Ok, thanks. That's good for me to know for #548, where we want to change chorus to on-the-fly calculation, rather than using lookup tables. |
The rendering functions, like
fluid_synth_write_float()
for example, are implemented with afor ()
cycle with inside some calculations. Inside this cycle, there is a block for ever sample:In my opinion, this piece of code could be rewritten in a more efficient way.
I made two
do...while
cycles and I moved this block outside the loop with the samples, which was more speed critical. On my plaftorms, the improvements were very interesting.It is true that we could use
FLUID_UNLIKELY
macro inside the 'if' statements, but in my opinion if we do not execute useless instructions, it would be better.However, it does not seem to be a difficult and dangerous change to me.
What do you think?
EDIT: of course, the content of that 'if' statement is executed at multiple of FLUID_BUFSIZE, the improvement comes out by eliminating the execution costs of the test at every cycle.
The text was updated successfully, but these errors were encountered: