I have a small question about how the Visual Scripting tool works, and more precisely about how smart does it translate our graphs into code, and even more precisely, is it smart enough to understand that sometimes, it can store some results to use them later instead of recomputing them.
I have this example :
My question focuses on the operation Index*6.
In any imperative programming language, I would have stored the result of this operation in an automatic variable called something like “currentSourceIndex” and re-used it to do the same for every “currentSourceIndex+1”, “currentSourceIndex+2” and “currentSourceIndex+3” operations. The idea is to avoid recomputing “Index * 6” several times unnecessarily.
So, is the Visual Scripting tool smart enough to understand this kind of things, or will it simply browse the graph from the Make Array node to the ForLoop node, and construct the formulas anew for each of its input pins, resulting in computing “Index*6” several times (between other things) ?
I need to understand this kind of subtleties, so I hope someone has the answer or some links to the documentations clarifying this kind of topics, which I couldn’t find on my own.
Thanks in advance !