Fast Expression Evaluation





3.00/5 (1 vote)
Use Expression += Value instead of Expression = Expression + Value. Since Expression can be arbitrarily complex, this can result in lots of unnecessary work. This forces the JIT to evaluate both copies of Expression, and many times this is not needed. The first statement can be optimized far...
Use Expression += Value instead of Expression = Expression + Value.
Since Expression can be arbitrarily complex, this can result in lots of unnecessary work. This forces the JIT to evaluate both copies of Expression, and many times this is not needed. The first statement can be optimized far better than the second, since the JIT can avoid evaluating the Expression twice.
N.B: Expression it self is a Variable not "Expression"..