I figured we could compile a list of optimization tips that people may find helpful. Are there optimization tricks that anyone have found helpful? I’ve looked up Lua optimization tips but I am unsure if these tips help in regards to audio work, especially specific to HALion. I’ve read things such as using local variables over global variables. But what happens when you are using the same variable hundreds of times. At that point is the hundreds of local variables more taxing than the one global? Or what if the global variable is an external local variable? Making strings and tables external of for loops makes sense to speed computation time but what about things that are HALion specific?
For example, is it more efficient to convert a parameter’s value to 1 using setParamterNormalized or getParameterNormalized and then perform math in relation to the value of that parameter being between 0 and 1? Or, is more efficient to just perform a math operation directly the value of the parameter?
Is it more efficient to build a mixed table and create a parameter with a function to pull from the values of the table to control HALion? Or, is it more efficient to create parameter and define it as a string. Then to use a Boolean to control HALion based on the value of the string?
These are just a couple examples but the point is, what can we do to make our code work the fastest and load the quickest? What have you tried that has given better results?