tags:

views:

18

answers:

1

I have just asked which one is better?

Static Vs Non-Static?

http://stackoverflow.com/questions/3016717/static-vs-non-static-method-performance-c

I would like to take this discussion one step ahead.

Consider If i pass reference of Panel control as parameter to Public static method, will static method still rules in performance?

+1  A: 

The performance difference between static and non-static methods is negligible, and I agree with posters on your previous question who stated that other concerns (readability of code, testability, etc) should be bigger factors in your decision.

Even in the realm of performance, many other factors (network access, SQL queries, algorithms) will become bottlenecks and deserve consideration more than the choice between a static or non-static method. I don't intend to be rude, but if you are concerned about application performance then you should be asking different questions.

John Bledsoe
Thanks for your answer, I believe that can cause difference if static method are trying to lock the execution. Specially when you are passing reference control. Consider 5000 visitors visiting same page at same time, which calls this static method, if it locks execution than i am sure it would give flicker effect.
dotnetguts
If you're blocking in a method that 5000 people are hitting all at the same time, you're doing it wrong.
womp
Agreed. The performance of your method will depend on factors such as locking, but that's independent of the static vs. non-static question.
John Bledsoe