I'm looking for ways to optimize the speed of evaluating expression. I am fine with losing readability as long as things evaluate quicker. From some experimenting, it looks like
Code: Select all
var1 = effect("Slider Control")("Slider");
var2 = effect("Slider Control 2")("Slider");
[var1, var2]
Code: Select all
[effect("Slider Control")("Slider"), effect("Slider Control 2")("Slider");]
However, what about in this example, where the variable is used more than once...
Code: Select all
var1 = effect("Slider Control")("Slider");
randomVar = random(-var1, var1)
[randomVar, randomVar]
Code: Select all
randomVar = random(-effect("Slider Control")("Slider"), effect("Slider Control")("Slider"))
[randomVar, randomVar]
Basically, I'm wondering in general, if a property is going to be used more than once is it worth the calculation time creating a variable, opposed to looking up the value?
Any other optimization advice is appreciated as well.