R
Robert Linder
Efficiency on Loops Using Class Variables
I have a loop that has a large loop e.g.System.Math.Pow( 2, 20).
I check a local variable against a class variable inside this loop.
// if ( localVariable > classVariable ){}
Does .Net perform better(faster) if I assign the class variable to a
local variable?
// double localVariable2 = classVariable
// for (){
// if ( localVariable > localVariable2 ){}
// }
I have a loop that has a large loop e.g.System.Math.Pow( 2, 20).
I check a local variable against a class variable inside this loop.
// if ( localVariable > classVariable ){}
Does .Net perform better(faster) if I assign the class variable to a
local variable?
// double localVariable2 = classVariable
// for (){
// if ( localVariable > localVariable2 ){}
// }