This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Hi, We have a requirement where in we need keep a class level attribute which holds some constant data and would be used in each method for logging purpose. Now the question is, should that attribute should be static or non-static? which is better from performance point of view? Thanks, Santhosh.
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
hi if they are not likely to change then u can go with, "final static" which would let compiler optimize it more... otherwise, static would be faster i believe as instance variables needs to be accessed from Heap going via the object reference... any better explanations? regards maulin.
Agreeing with Thomas -- even if there were a performance difference, it shouldn't even enter the picture here. The question smacks of premature optimisation. Way premature. - Peter
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.